parse-keys
v1.3.0
Published
JSON.parse only object keys
Downloads
444
Readme
parse-keys
JSON.parse only object keys
Install
$ npm i parse--keys --save
Usage
//server.js
'use strict'
var parse = require('parse-keys');
var env = parse(process.env, ['PORT']);
console.log(process.env.PORT) === "4000"
//while
console.log(env.PORT) === 4000
$ PORT=4000 node server.js