Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

vweevers/node-in-production

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Two simple variants of NODE_ENV === production

Resources

License

Stars

Watchers

Forks

Packages

No packages published