yanv

1.1.0 • Public • Published

Yanv

Tiny CLI that converts any YAML file into a .env file.

ℹ️ This lib is intended to be used with the dotenv lib.

Features

The package includes the following features:

  • watch for file change: --watch or -w
  • run a command after .env generation: --command or -c
  • take custom file: --file or -f
  • look for YAML .env with specific suffix file: --suffix or -s
  • output in a .env file instead of running command with the loaded environment: --output or -o
  • avoid overriding existing environment variables: --noOverride or -n

Get started

  1. Install the dependecy as dev dependency:
npm install --dev yanv
yarn add --dev yanv
pnpm add --save-dev yanv
  1. Use yanv in your package.json scripts like:
# Basic usage. Will build .env.yaml or .env.yml
yanv
# Run a command and watch for env. changes
yanv -c 'yarn dev' --watch
# Look for .env.staging.yaml or .env.staging.yml
yanv -s 'staging' --watch
# Look for a specific file
yanv -c 'yarn dev' --watch --file yanv/my-yanv.yaml

Why this lib?

At Fifteen, we have some projects with a lot a .env configurations in variables, including ones which change frequently for internal testing (API URLs, theming, config...).

We developped this lib to suit our needs, notably by using the --watch and --command options.

Readme

Keywords

none

Package Sidebar

Install

npm i yanv

Weekly Downloads

18

Version

1.1.0

License

MIT

Unpacked Size

7.81 kB

Total Files

5

Last publish

Collaborators

  • qnp
  • arthur-bri
  • frobaglia