sindresorhus / get-stdin

Get stdin as a string or buffer
MIT License
337 stars 28 forks source link

Load stdin lazily #17

Closed ishamf closed 8 years ago

ishamf commented 8 years ago

I encountered this while tracking a bug in an Atom extension I used. Apparently, in Atom accessing process.stdin throws an exception. This makes a huge library unusable there, since calling require('get-stdin') accesses process.stdin, even though the extension doesn't use it.

sindresorhus commented 8 years ago

Can you open an issue on Atom first? And comment a link here. process.stdin is expected to exist in the Node.js ecosystem, so this is an Atom bug.

ishamf commented 8 years ago

Ok, I've researched this a bit and it seems like it has something to do with how windows treats desktop apps, so I don't think it will be fixed anytime soon.

Disregarding windows quirks for a moment, I still think it's a good idea to load stdin lazily, if only to avoid running the stdin initialization code unnecessarily.

ishamf commented 8 years ago

Fixed on recent versions of electron.