env-object-parser

1.1.0 • Public • Published

env-object-parser

npm npm license npm downloads travis

Parse a set of environment variables as a JSON object

Installation

Install env-object-parser by running:

npm install --save env-object-parser

Documentation

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 test

Contribute

Before submitting a PR, please make sure that you include tests, and that the linter runs without any warning:

npm run lint

Support

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.

Readme

Keywords

none

Package Sidebar

Install

npm i env-object-parser

Weekly Downloads

1

Version

1.1.0

License

Apache-2.0

Unpacked Size

27.9 kB

Total Files

11

Last publish

Collaborators

  • balena.io