5.0.3 â€ĸ Published 25 days ago

@hugoalh/github-sodium v5.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
25 days ago

GitHub Sodium (ES)

⚖ī¸ MIT

GitHub: hugoalh-studio/github-sodium-es JSR: @hugoalh/github-sodium NPM: @hugoalh/github-sodium

An ES (JavaScript & TypeScript) module to provide an easier sodium for GitHub secrets.

This project is based on "libsodium.js" with optimization for GitHub secrets.

đŸŽ¯ Target

  • Bun ^ v1.0.0
  • Cloudflare Workers
  • Deno >= v1.34.0 / >= v1.41.1 (For JSR Only)

    🛡ī¸ Require Permission

    N/A

  • NodeJS >= v16.13.0

🔰 Usage

Via JSR With node_modules

đŸŽ¯ Supported Target

  • Bun
  • Cloudflare Workers
  • NodeJS
  1. Install via:
    • Bun
      bunx jsr add @hugoalh/github-sodium[@${Tag}]
    • NPM
      npx jsr add @hugoalh/github-sodium[@${Tag}]
    • PNPM
      pnpm dlx jsr add @hugoalh/github-sodium[@${Tag}]
    • Yarn
      yarn dlx jsr add @hugoalh/github-sodium[@${Tag}]
  2. Import at the script:
    import ... from "@hugoalh/github-sodium";

ℹī¸ Note

  • Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit file jsr.jsonc property exports for available sub paths.
  • It is recommended to import the module with tag for immutability.

Via JSR With Specifier

đŸŽ¯ Supported Target

  • Deno
  1. Import at the script:
    import ... from "jsr:@hugoalh/github-sodium[@${Tag}]";

ℹī¸ Note

  • Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit file jsr.jsonc property exports for available sub paths.
  • It is recommended to import the module with tag for immutability.

Via NPM With node_modules

đŸŽ¯ Supported Target

  • Cloudflare Workers
  • NodeJS
  1. Install via:
    • NPM
      npm install @hugoalh/github-sodium[@${Tag}]
    • PNPM
      pnpm add @hugoalh/github-sodium[@${Tag}]
    • Yarn
      yarn add @hugoalh/github-sodium[@${Tag}]
  2. Import at the script:
    import ... from "@hugoalh/github-sodium";

ℹī¸ Note

  • Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit file jsr.jsonc property exports for available sub paths.
  • It is recommended to import the module with tag for immutability.

Via NPM With Specifier

đŸŽ¯ Supported Target

  • Bun
  • Deno
  1. Import at the script:
    import ... from "npm:@hugoalh/github-sodium[@${Tag}]";

ℹī¸ Note

  • Although it is recommended to import the entire module, it is also able to import part of the module with sub path if available, please visit file jsr.jsonc property exports for available sub paths.
  • It is recommended to import the module with tag for immutability.

Via Remote Import

đŸŽ¯ Supported Target

  • Deno
  1. Import at the script:
    /* Via GitHub Raw (Require Tag) */
    import ... from "https://raw.githubusercontent.com/hugoalh-studio/github-sodium-es/${Tag}/mod.ts";

ℹī¸ Note

  • Although it is recommended to import the entire module with the main path mod.ts, it is also able to import part of the module with sub path if available, but do not import if:

    • it's file path has an underscore prefix (e.g.: _foo.ts, _util/bar.ts), or
    • it is a benchmark or test file (e.g.: foo.bench.ts, foo.test.ts), or
    • it's symbol has an underscore prefix (e.g.: export function _baz() {}).

    These elements are not considered part of the public API, thus no stability is guaranteed for them.

  • Although there have 3rd party services which provide enhanced, equal, or similar methods/ways to remote import the module, beware these services maybe inject unrelated elements and thus affect the security.

🧩 API

  • class GitHubSodiumSealer {
      constructor(publicKey: string): GitHubSodiumSealer;
      encrypt(value: string): string;
      static seal(publicKey: string, value: string): string;
    }
  • function seal(publicKey: string, value: string): string;

✍ī¸ Example

  • new GitHubSodiumSealer("2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvv1234").encrypt("plain-text-secret");
5.0.3

25 days ago

5.0.2

1 month ago

5.0.1

4 months ago

5.0.0

4 months ago

4.0.0

7 months ago

3.1.2

1 year ago

3.1.1

1 year ago

3.0.2

1 year ago

3.1.0

1 year ago

3.0.1

2 years ago

2.0.3

2 years ago

3.0.0

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

2.0.0-beta.1

2 years ago

1.1.6

2 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

4 years ago