Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 887 Bytes

README.md

File metadata and controls

40 lines (31 loc) · 887 Bytes

3nv

tool for managing .env file

yarn add 3nv

Usage

Get config from .env file without modifying process.env

import { init } from './lib/index.js';

const config = init();

Init parameters:

Name Default value Possible values Description
path '.env' string Path to .env file
modifyProcessEnv false boolean Add env vars to process.env object
verbose false boolean Extended logging
copyFromExample true boolean Copy .env.example content to .env file if it doesn't exists

CLI

The package provides command for copying your .env template to .env.example file:

# package.json
{
  "scripts": {
    "dump": "3nv dump"
  }
}
yarn dump