2.0.7 • Published 4 years ago
3nv v2.0.7
3nv
tool for managing .env file
yarn add 3nvUsage
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