3.4.0 • Published 3 months ago

envk v3.4.0

Weekly downloads
134
License
MIT
Repository
github
Last release
3 months ago

envk

This packages lets you autoload your environment variables from your .env file, no code changes required.

Similar to dotenv, but with zero-dependencies and less verbose.

Easy as:

yarn add envk
node -r envk index.js # autoloads .env file

Features:

  • auto-detect of .env.<NODE_ENV> or .env file
  • support for custom .env filename with ENVK environment variable
  • support for variable expansiong
  • support for single quotes
  • support for double quotes
  • support for empty lines
  • support for multiline quoting with double quotes "SECRET=hello\nworld"
  • support for comments prefixing the line with #

You can see what's happening inspecting index.js.

Nothing more, nothing less.

Usage

Load envs from .env:

node -r envk index.js

Load envs from .env.production file, otherwise .env:

NODE_ENV=production node -r envk index.js

Load envs from specific file:

ENVK=file.env node -r envk index.js

Log to console imported variables:

ENVK_DEBUG=1 node -r envk index.js
3.4.0

3 months ago

3.3.0

3 months ago

3.2.3

3 months ago

3.2.2

2 years ago

3.2.1

2 years ago

3.2.0

2 years ago

3.1.0

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago