envparse

1.1.0 • Public • Published

This is a tiny library for NodeJS which parses environment variables and converts them into a deeply nested object.

index.js

var envparse = require('envparse')
 
console.log(envparse('TEST'))
$ TEST_user=bobby node index.js
{ user: "bobby" }
$ TEST_database_username=bla
$ TEST_database_password=morebla
$ node index.js
{ database: { username: "bla", password: "morebla" } }

API

envparse(opts)

Where opts is an object containing:

  • prefix: the prefix that will be searched for optional

If opts is a string, it will use that string as a prefix.

License

The MIT License

Package Sidebar

Install

npm i envparse

Weekly Downloads

2

Version

1.1.0

License

MIT

Last publish

Collaborators

  • samvv