@tkesgar/reno
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@tkesgar/reno

TypeScript Code style: ESLint Prettier Jest Conventional Commits Build Status codecov

You think they're big too? They really get in the way...

reno is a library to work with environment variables.

Installation

npm install @tkesgar/reno

Usage

loadEnv(opts?)

Loads the following env files in order:

  • Local env (.env)
  • Local environment env (e.g. production.local.env)
  • Environment env (e.g. production.env)
  • Default env (e.g. default.env)

reno internally uses dotenv. If an env file does not exist it will skipped, and any environment variables specified earlier will not be overridden.

Environment name is determined from opts.env (defaults to the value of NODE_ENV). If opts.env is null, environment env files will be skipped.

*.local.env can be skipped by setting opts.loadLocalEnv to false.

The default env file name is specified by opts.default (defaults to default.env).

getEnv(): string

Returns the value of NODE_ENV. Defaults to "development" if NODE_ENV environment variable is not set.

isDevelopment(): boolean

Alias to getEnv() === "development".

isProduction(): boolean

Alias to getEnv() === "production".

Contributing

Feel free to submit issues and create pull requests.

License

Licensed under MIT License.

Readme

Keywords

Package Sidebar

Install

npm i @tkesgar/reno

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

8.23 kB

Total Files

7

Last publish

Collaborators

  • tkesgar