Feature detect if browser or node.js#85
Feature detect if browser or node.js#85mushishi78 wants to merge 1 commit intodefunctzombie:masterfrom mushishi78:master
Conversation
|
this is the thing that's supposed to be adding the global.process, I'm not sure you can check against it for this module. |
|
This is not adding the process object to the global process variable, it's adding it to the export for this package. The purpose is so that if you want to be agnostic about whether you're in browser, you can rely on the import of this library being there but you can't rely on the global variable being there. The reason I needed this is because I'm trying out a bundler that doesn't respect the "browser" field in the package.json. I saw that the linked Could also probably just do this if you prefer: module.exports = global.process || require('./browser.js'); |
Taken from https://github.com/visionmedia/debug/blob/master/src/index.js