@ladjs/env
Version:
Environment configuration loader for Lad
79 lines (50 loc) • 1.81 kB
Markdown
# [**@ladjs/env**](https://github.com/ladjs/env)
[](https://github.com/ladjs/env/actions/workflows/ci.yml)
[](https://github.com/sindresorhus/xo)
[](https://github.com/prettier/prettier)
[](https://lass.js.org)
[]()
> Environment configuration loader for Lad
## Table of Contents
* [Install](#install)
* [Usage](#usage)
* [Options](#options)
* [Contributors](#contributors)
* [License](#license)
## Install
[npm][]:
```sh
npm install @ladjs/env
```
## Usage
```js
const env = require('@ladjs/env')();
console.log(env);
```
## Options
You can pass any option as you otherwise would normally to [dotenv-extended][].
Here is the default option argument, note that it supports a `.env.test` path for `TEST` and `TESTING` environments as specified through `process.env.NODE_ENV`.
```js
const env = require('@ladjs/env')({
encoding: 'utf8',
silent: true,
path: '.env',
defaults: '.env.defaults',
schema: '.env.schema',
errorOnMissing: true,
errorOnExtra: true,
errorOnRegex: false,
includeProcessEnv: true,
assignToProcessEnv: true,
overrideProcessEnv: false,
});
```
## Contributors
| Name | Website |
| -------------- | -------------------------- |
| **Nick Baugh** | <http://niftylettuce.com/> |
## License
[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)
##
[npm]: https://www.npmjs.com/
[dotenv-extended]: https://github.com/keithmorris/node-dotenv-extended