defunctzombie / node-process

process information for node.js and browsers
MIT License
122 stars 62 forks source link

Extend even emitter instead of noop'ing those methods #53

Closed wesleytodd closed 8 years ago

wesleytodd commented 8 years ago

Is there a reason to noop the event emitter methods instead of just extending from the event emitter?

I was thinking of patching process.on('uncaughtException', function(){}) with window.onerror to handle this in the browser, but I would have to also patch these methods. I could submit a PR with all of this if that is something you are interested in having. Let me know!

calvinmetcalf commented 8 years ago

the reason is because lots of people use this just for process.nextTick and process.browser so we want to keep it as small as possible

On Fri, Nov 13, 2015 at 5:44 PM Wes Todd notifications@github.com wrote:

Is there a reason to noop the event emitter methods instead of just extending from the (event emitter)[https://www.npmjs.com/package/events]?

I was thinking of patching process.on('uncaughtException', function(){}) with window.onerror to handle this in the browser, but I would have to also patch these methods. I could submit a PR with all of this if that is something you are interested in having. Let me know!

— Reply to this email directly or view it on GitHub https://github.com/defunctzombie/node-process/issues/53.

wesleytodd commented 8 years ago

So the recommended method is to patch it with your own module?

calvinmetcalf commented 8 years ago

yeah that would probably be best, or create a module that works isomorphicly, returning process if it's in node and and event emitter you created otherwise that

wesleytodd commented 8 years ago

yeah, that is was I meant, just wasn't clear in my comment :)

calvinmetcalf commented 8 years ago

:+1: then