Skip to content

Commit

Permalink
docs: add historical context and word of warning (fixes #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Coe committed May 17, 2016
1 parent 7d0c45e commit 96339bd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -13,6 +13,18 @@ setBlocking(true)
console.log(someLargeStringToOutput)
```

## Historical Context/Word of Warning

This shim 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
newer versions of Node.js (`0.12+`). You should be mindful of the side-effects
caused by `set-blocking`:

* if your module sets blocking to `true`, it will effect other modules
consuming your library. In [yargs](https://github.com/yargs/yargs/blob/master/yargs.js#L653) we only call
`setBlocking(true)` once we already know we are about to call `process.exit(code)`.
* this patch will not apply to subprocesses spawned with `isTTY = true`, this is
the [default `spawn()` behavior](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options).

## License

ISC

0 comments on commit 96339bd

Please sign in to comment.