Skip to content

Commit 1561749

Browse files
committed
docs: add historical context and word of warning (fixes #2) (#4)
* docs: add historical context and word of warning (fixes #2) * nit: too many shims * nit: working on copy of warning
1 parent 66ce277 commit 1561749

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ setBlocking(true)
1313
console.log(someLargeStringToOutput)
1414
```
1515

16+
## Historical Context/Word of Warning
17+
18+
This was created as a shim to address the bug discussed in [node #6456](https://github.com/nodejs/node/issues/6456). This bug crops up on
19+
newer versions of Node.js (`0.12+`), truncating terminal output.
20+
21+
You should be mindful of the side-effects caused by using `set-blocking`:
22+
23+
* if your module sets blocking to `true`, it will effect other modules
24+
consuming your library. In [yargs](https://github.com/yargs/yargs/blob/master/yargs.js#L653) we only call
25+
`setBlocking(true)` once we already know we are about to call `process.exit(code)`.
26+
* this patch will not apply to subprocesses spawned with `isTTY = true`, this is
27+
the [default `spawn()` behavior](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options).
28+
1629
## License
1730

1831
ISC

0 commit comments

Comments
 (0)