env-parser
v1.0.1
Published
Streaming environment variable parser
Downloads
1,835
Maintainers
Readme
env-parser
Streaming environment variable parser
Transform module to handle single properly formed key=value pairs and create javascript objects from them. Will split on first = and remove quotation from value if present.
Examples
Require module
var envParser = require('env-parser')()
Listen for data events
envParser.on('data', function (envObjec) {
//do something with env object which will look like
// { key: 'ENV_KEY', value: 'some value' }
})
Write env data
envParser.write('ENV_KEY="some value"')
//or
envParser.write('ENV_KEY=some value')