Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nenv

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nenv - npm Package Compare versions

Comparing version 0.5.4 to 1.0.0

25

lib/index.js

@@ -15,5 +15,9 @@ var defaults = ['test', 'devel', 'stage', 'production'];

var value = '' + this.value;
if(this(val)) {
process.env.NODE_ENV = val;
this.current = val;
// considered defined the first time the setter
// is called explicitly
this.defined = true;
return function revert() {

@@ -36,3 +40,3 @@ process.env.NODE_ENV = value;

*/
function nenv(available, get, set, dbg) {
function nenv(options = {}) {

@@ -43,2 +47,7 @@ if(nenv.cache && !arguments.length) {

let available = options.available
let get = options.get
let set = options.set
let dbg = options.dbg
if(typeof available === 'function') {

@@ -183,2 +192,16 @@ get = available;

if (options.strict === true) {
if (!query.defined) {
throw new TypeError('Expected NODE_ENV to be defined')
}
if (!query.valid) {
throw new TypeError(
'Unknown value for NODE_ENV "' +
query.value +
'", should be one of: ' +
query.keys.join(', '))
}
}
return query;

@@ -185,0 +208,0 @@ }

2

package.json
{
"name": "nenv",
"description": "Node development environment manager",
"version": "0.5.4",
"version": "1.0.0",
"author": "muji <noop@xpm.io>",

@@ -6,0 +6,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc