npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

env-writer

2.0.0 • Public • Published

Build Status

NPM

Media Suite

env-writer

Streaming process.env writer

Simple flexible env writer.

Accepts arrays and objects as parameters to write to process.env

Require the module:

var env = require('env-writer')()

Write a single value (all three of the following are valid):

env.write({
    key: 'ANIMAL',
    value: 'cat'
});
 
//or
env.write({'BEER': 'Tui'})
 
//or
env.write(['DESSERT', 'Pavlova'])

Multiple values with a single write:

env.write({
  'BEER1': 'Tui',
  'BEER2': 'DB',
  'BEER3': 'Gissie Green'
});
 
//or
env.write([
  ['DESSERT1', 'Cheesecake'],
  ['DESSERT2', 'Chocolate cake'],
  ['DESSERT3', 'Fudge with ice cream'],
]);

env-writer will also accept json strings. So any of the above could be achieved with something like:

env.write('["DOG:"Mr Bones"]')

env-writter also handles buffers so you can pipe valid json from stdin or any other source.

process.stdin.pipe(env)

install

npm i env-writer

Downloadsweekly downloads

378

version

2.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability