in-production

1.0.1 • Public • Published

in-production

Two simple variants of NODE_ENV === production. Exports a boolean or a function, which turns into a noop when browserified. Best combined with uglifyify as a transform to remove dead code.

npm status

example

As a boolean, using a cached process.env.NODE_ENV

var inProduction = require('in-production')
 
if (inProduction) //..

As a function, using an uncached process.env.NODE_ENV

var inProduction = require('in-production/function')
 
if (inProduction()) // ..

install

With npm do:

npm install in-production

license

MIT © Vincent Weevers

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    2
  • 1.0.0
    1

Package Sidebar

Install

npm i in-production

Weekly Downloads

3

Version

1.0.1

License

MIT

Last publish

Collaborators

  • vweevers