occams-env
Version:
A simple node app env & settings module.
64 lines (40 loc) • 1.27 kB
Markdown
# occams-env
> A simple node app env & settings module.
[](https://badge.fury.io/js/occams-env) [](https://github.com/xojs/xo)
### Features
- Built on top of [occams-conf](https://github.com/lxghtless/occams-conf#readme) and [dotenv](https://github.com/motdotla/dotenv#readme)
- Import dotenv envs into [occams-conf](https://github.com/lxghtless/occams-conf#readme) with camel keys automatically.
## First things first...
```
$ npm i occams-env
```
## Usage
### Envs
`occams-env` supports all the envs [occams-conf](https://github.com/lxghtless/occams-conf) does. Additionally, the following can be set.
`OCCAMS_ENV_IMPORT_ENVS`: Enables import of `process.env` keys into `occams-conf` with camel keys.
### Example
```js
const oe = require('occams-env');
oe.get('home');
//=> /Users/awesome-dev
oe.home;
//=> /Users/awesome-dev
```
## API
### occamsEnv.get
#### keyPath
Type: `string`
Property path to get from configuration.
## CLI
```
$ npm i -g occams-env
```
```
$ oe --help
Usage
Search for a key path in the oe configuration.
$ oe [keyPath]
Examples
$ oe home
/Users/awesome-dev
```