open-index/open-npm huggingface dataset:
npm package: @hsjs/vault
Description: ## Install
Latest version: 0.0.6

# @hsjs/vault

## Install

```sh
yarn add @hsjs/vault
```

## Usage

```javascript
import { encrypt, decrypt } from "@hsjs/vault";

encrypt("SecretPassw0rd", "YourPlaintext", { b64Output: true });
// returns "eyJpdiI6...itTdklKeFlmc1RTcz0ifQ=="

decrypt("SecretPassw0rd", "eyJpdiI6...itTdklKeFlmc1RTcz0ifQ==", {
  b64Input: true,
});
// returns "YourPlaintext"
```

## API

**encrypt**

```typescript
function encrypt(
  password: string,
  plaintext: string,
  opts: VaultOptions = {}
): string;

type VaultOptions = { b64Input?: boolean; b64Output?: boolean };
```

**decrypt**

```typescript
function decrypt(
  password: string,
  ciphertext: string,
  opts: VaultOptions = {}
): string;

type VaultOptions = { b64Input?: boolean; b64Output?: boolean };
```
npm package: @hsjs/vault-cli
Description: ## Install
Latest version: 0.0.9

# @hsjs/vault-cli

## Install

```sh
yarn global add @hsjs/vault-cli
```

## Usage

**encrypt**

```
$ vault encrypt -h

  Description
    encrypt a string or file

  Usage
    $ vault encrypt [options]

  Options
    --input-str              Input string
    -i, --input-file         Input file
    --b64-input              Flag to indicate input was base64 encoded  (default false)
    --b64-output             Enable base64'ed output  (default false)
    -o, --output-file        Output file
    --vault-password-file    Vault password file (leading and tailing spaces in the file will be trimmed)
    -p, --vault-password     Vault password (leading and tailing spaces of the string will be trimmed)
    -h, --help               Displays this message

  Examples
    $ vault encrypt --input-file .env -p passw0rd --b64-output --output-file env.enc
    $ vault encrypt --input-file .env --vault-password-file password.txt --b64-output --output-file env.enc
```

**decrypt**

```
$ vault decrypt -h

  Description
    decrypt a string or file

  Usage
    $ vault decrypt [options]

  Options
    --input-str              Input string
    -i, --input-file         Input file
    --b64-input              Flag to indicate input was base64 encoded  (default false)
    --b64-output             Enable base64'ed output  (default false)
    -o, --output-file        Output file
    --vault-password-file    Vault password file (leading and tailing spaces in the file will be trimmed)
    -p, --vault-password     Vault password (leading and tailing spaces of the string will be trimmed)
    -h, --help               Displays this message

  Examples
    $ vault decrypt --input-file env.enc -p passw0rd --b64-input --output-file env.txt
    $ vault decrypt --input-file env.enc --vault-password-file password.txt --b64-input --output-file env.txt
```