2.0.0 • Published 10 years ago

env-writer v2.0.0

Weekly downloads
716
License
MIT
Repository
github
Last release
10 years ago

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)
2.0.0

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago