diff --git a/src/bin.js b/src/bin.js index 05e7b09..961d3b1 100644 --- a/src/bin.js +++ b/src/bin.js @@ -1,5 +1,6 @@ #!/usr/bin/env node +import './blocked-io'; import commander from 'commander'; import Emitter from './emitter'; diff --git a/src/blocked-io.js b/src/blocked-io.js new file mode 100644 index 0000000..f8211db --- /dev/null +++ b/src/blocked-io.js @@ -0,0 +1,5 @@ +[process.stdout, process.stderr].forEach(stream => { + if (stream._handle && typeof stream._handle.setBlocking === 'function') { + stream._handle.setBlocking(true); + } +});