A mirror of Facebook's invariant
(e.g. React, flux).
npm install envify invariant
var invariant = require('invariant');
When used with browserify
, it'll use browser.js
(instead of invariant.js
) and the envify
transform will inline the value of process.env.NODE_ENV
.
The node version is optimized around the performance implications of accessing process.env
. The value of process.env.NODE_ENV
is cached, and repeatedly used instead of reading proces.env
. See Server rendering is slower with npm react #812