Ideally (IMHO) there would be no globals besides the 4 node keywords required for the module system to function: require, module, __dirname and __filename.
For many of the other modules that are typically globals, you can require them out of the box, such as
var console = require('console');
var setTimeout = require('timers').setTimeout; // same with clearTimeout, setInterval and clearInterval
var Buffer = require('buffer');
// etc...
One of the few standard parts of node that cannot be loaded via require() is process.
The popularity of this npm module: https://www.npmjs.com/package/process , with almost a million downloads in the last month shows that a lot of people would benefit from having process be requireable. By making it requireable, browserify can then treat it as one of the special compatibility modules and list it here: https://github.com/substack/node-browserify#compatibility
Ideally (IMHO) there would be no globals besides the 4 node keywords required for the module system to function:
require,module,__dirnameand__filename.For many of the other modules that are typically globals, you can require them out of the box, such as
One of the few standard parts of node that cannot be loaded via
require()isprocess.The popularity of this npm module: https://www.npmjs.com/package/process , with almost a million downloads in the last month shows that a lot of people would benefit from having
processbe requireable. By making it requireable, browserify can then treat it as one of the special compatibility modules and list it here: https://github.com/substack/node-browserify#compatibility