set-blocking (2.0.0)

Published 2026-02-24 14:04:57 +00:00 by atheaadmin

Installation

registry=
npm install set-blocking@2.0.0
"set-blocking": "2.0.0"

About this package

set-blocking

Build Status NPM version Coverage Status Standard Version

set blocking stdio and stderr ensuring that terminal output does not truncate.

const setBlocking = require('set-blocking')
setBlocking(true)
console.log(someLargeStringToOutput)

Historical Context/Word of Warning

This was created as a shim to address the bug discussed in node #6456. This bug crops up on newer versions of Node.js (0.12+), truncating terminal output.

You should be mindful of the side-effects caused by using set-blocking:

  • if your module sets blocking to true, it will effect other modules consuming your library. In yargs 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.

License

ISC

Dependencies

Development Dependencies

ID Version
chai ^3.5.0
coveralls ^2.11.9
mocha ^2.4.5
nyc ^6.4.4
standard ^7.0.1
standard-version ^2.2.1

Keywords

flush terminal blocking shim stdio stderr
Details
npm
2026-02-24 14:04:57 +00:00
0
Ben Coe
ISC
latest
2.2 KiB
Assets (1)
Versions (1) View all
2.0.0 2026-02-24