aboutsummaryrefslogtreecommitdiff
path: root/node_modules/yargs/build/lib/utils/set-blocking.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/yargs/build/lib/utils/set-blocking.js')
-rw-r--r--node_modules/yargs/build/lib/utils/set-blocking.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/node_modules/yargs/build/lib/utils/set-blocking.js b/node_modules/yargs/build/lib/utils/set-blocking.js
new file mode 100644
index 0000000..88fb806
--- /dev/null
+++ b/node_modules/yargs/build/lib/utils/set-blocking.js
@@ -0,0 +1,12 @@
+export default function setBlocking(blocking) {
+ if (typeof process === 'undefined')
+ return;
+ [process.stdout, process.stderr].forEach(_stream => {
+ const stream = _stream;
+ if (stream._handle &&
+ stream.isTTY &&
+ typeof stream._handle.setBlocking === 'function') {
+ stream._handle.setBlocking(blocking);
+ }
+ });
+}