Skip to content

Instantly share code, notes, and snippets.

@saghul
Created September 22, 2014 09:52
Show Gist options
  • Save saghul/8cd124de8c2f423a74f3 to your computer and use it in GitHub Desktop.
Save saghul/8cd124de8c2f423a74f3 to your computer and use it in GitHub Desktop.
var constants = require('constants');
process.stdin.on('error', function(error) {
if (error.errno == constants.EBADF)
console.log('stdin is unusable');
else
console.log('stdin error! ' + error);
});
process.stdin.resume()
setTimeout(function() {console.log('timer!');}, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment