README
GitHub Sodium (NodeJS)
Release | Latest () | Pre () |
---|---|---|
GitHub | ||
NPM |
📝 Description
A NodeJS module to provide an easier sodium for GitHub secret.
This project is based on TweetSodium (GitHub)(NPM) with optimization for GitHub secret.
📚 Documentation
Getting Started
Install
NodeJS (>= v14.15.0) + NPM (>= v6.14.8):
npm install @hugoalh/github-sodium
Use In CommonJS
const githubSodium = require("@hugoalh/github-sodium");
Use In ModuleJS
import githubSodium from "@hugoalh/github-sodium";
API
githubSodium(// Encrypt value to GitHub secret value.
publicKey: string,// Organization's or repository's public key, which need for encrypt value to secret value before create or update a secret.
value: string// Value that need to encrypt as secret value.
): string// An encrypted GitHub secret value.
Example
githubSodium("base64-encoded-public-key", "plain-text-secret");
//=> "+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0="