New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nodeenv

Package Overview
Dependencies
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodeenv

nodeenv enables tests to control the NODE_ENV variable.

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
600
decreased by-37.95%
Maintainers
1
Weekly downloads
 
Created
Source

nodeenv

nodeenv enables tests to control the NODE_ENV variable.

If you have any questions or feedback, feel free to contact me using @goloroden on Twitter.

Installation

$ npm install nodeenv

Quick start

To use nodeenv you need to integrate it to your unit-tests using the require function.

var nodeenv = require('nodeenv');

Then, you can call the nodeenv function and specify the value for NODE_ENV you would like to use as well as a callback that contains the code that shall be run in the given environment.

nodeenv('dev', function () {
  // ...
});

Once the callback returns, the previous value of NODE_ENV is automatically restored.

Running the tests

nodeenv has been developed using TDD. To run the tests, go to the folder where you have installed nodeenv to and run npm test. You need to have mocha installed.

$ npm test

Additionally, this module can be built using Grunt. Besides running the tests, Grunt also analyses the code using JSHint. To run Grunt, go to the folder where you have installed nodeenv and run grunt. You need to have grunt-cli installed.

$ grunt

FAQs

Package last updated on 20 Dec 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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