electron-johnny-five-examples
electron-johnny-five-examples copied to clipboard
Hook in our stream
May I ask what does this part of code do: https://github.com/sofroniewn/electron-johnny-five-examples/blob/master/2-switch/app/index.js#L5-L15
var Readable = require('stream').Readable
var util = require('util')
util.inherits(MyStream, Readable)
function MyStream(opt) {
Readable.call(this, opt)
}
MyStream.prototype._read = function() {};
// hook in our stream
process.__defineGetter__('stdin', function() {
if (process.__stdin) return process.__stdin
process.__stdin = new MyStream()
return process.__stdin
})