Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Make process requireable #8866

Closed
andrewdeandrade opened this issue Dec 12, 2014 · 6 comments
Closed

Make process requireable #8866

andrewdeandrade opened this issue Dec 12, 2014 · 6 comments

Comments

@andrewdeandrade
Copy link

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

@lxe
Copy link

lxe commented Dec 12, 2014

👍

1 similar comment
@benmkramer
Copy link

👍

@cjihrig
Copy link

cjihrig commented Jan 2, 2015

@tjfontaine thoughts on this?

@Mickael-van-der-Beek
Copy link

👍

@andrewdeandrade
Copy link
Author

Same issue on io.js
nodejs/node#157

Pull Request closing that issue on io.js
nodejs/node#206

@brendanashworth
Copy link

This is now in node 4 (nodejs/node@d8586ea) and probably won't be backported, so I'll close this for now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants