1.1.0 • Published 8 years ago
env-object-parser v1.1.0
env-object-parser
Parse a set of environment variables as a JSON object
Installation
Install env-object-parser by running:
npm install --save env-object-parserDocumentation
module.exports(environment, options) ⇒ Object ⏏
Kind: Exported function
Summary: Parse an environment object
Returns: Object - parsed object
Access: public
| Param | Type | Description |
|---|---|---|
| environment | Object | environment object |
| options | Object | options |
| options.prefix | String | environment prefix |
Example
const envObjectParser = require('env-object-parser')
process.env.FOO_BAR = 'baz'
const result = envObjectParser(process.env, {
prefix: 'FOO'
})
console.log(result.bar)
> 'baz'Tests
Run the test npm script:
npm testContribute
- Issue Tracker: github.com/resin-io-modules/env-object-parser/issues
- Source Code: github.com/resin-io-modules/env-object-parser
Before submitting a PR, please make sure that you include tests, and that the linter runs without any warning:
npm run lintSupport
If you're having any problem, please raise an issue on GitHub.
License
This project is free software, and may be redistributed under the terms specified in the license.