updated sys and created publi
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
<a name="2.0.0"></a>
|
||||
# [2.0.0](https://github.com/yargs/set-blocking/compare/v1.0.0...v2.0.0) (2016-05-17)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add an isTTY check ([#3](https://github.com/yargs/set-blocking/issues/3)) ([66ce277](https://github.com/yargs/set-blocking/commit/66ce277))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* stdio/stderr will not be set to blocking if isTTY === false
|
||||
|
||||
|
||||
|
||||
<a name="1.0.0"></a>
|
||||
# 1.0.0 (2016-05-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* implemented shim for stream._handle.setBlocking ([6bde0c0](https://github.com/yargs/set-blocking/commit/6bde0c0))
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
Copyright (c) 2016, Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted, provided
|
||||
that the above copyright notice and this permission notice
|
||||
appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
|
||||
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
||||
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
# set-blocking
|
||||
|
||||
[](https://travis-ci.org/yargs/set-blocking)
|
||||
[](https://www.npmjs.com/package/set-blocking)
|
||||
[](https://coveralls.io/r/yargs/set-blocking?branch=master)
|
||||
[](https://github.com/conventional-changelog/standard-version)
|
||||
|
||||
set blocking `stdio` and `stderr` ensuring that terminal output does not truncate.
|
||||
|
||||
```js
|
||||
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](https://github.com/nodejs/node/issues/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](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
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
module.exports = function (blocking) {
|
||||
[process.stdout, process.stderr].forEach(function (stream) {
|
||||
if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === 'function') {
|
||||
stream._handle.setBlocking(blocking)
|
||||
}
|
||||
})
|
||||
}
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"raw": "set-blocking@~2.0.0",
|
||||
"scope": null,
|
||||
"escapedName": "set-blocking",
|
||||
"name": "set-blocking",
|
||||
"rawSpec": "~2.0.0",
|
||||
"spec": ">=2.0.0 <2.1.0",
|
||||
"type": "range"
|
||||
},
|
||||
"/mnt/Data/bach/Documents/ola/OLA#4/OLA#4DOC/sys/node_modules/npmlog"
|
||||
]
|
||||
],
|
||||
"_from": "set-blocking@>=2.0.0 <2.1.0",
|
||||
"_id": "set-blocking@2.0.0",
|
||||
"_inCache": true,
|
||||
"_location": "/set-blocking",
|
||||
"_nodeVersion": "0.12.7",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/set-blocking-2.0.0.tgz_1463525966987_0.5456729622092098"
|
||||
},
|
||||
"_npmUser": {
|
||||
"name": "bcoe",
|
||||
"email": "ben@npmjs.com"
|
||||
},
|
||||
"_npmVersion": "2.11.3",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"raw": "set-blocking@~2.0.0",
|
||||
"scope": null,
|
||||
"escapedName": "set-blocking",
|
||||
"name": "set-blocking",
|
||||
"rawSpec": "~2.0.0",
|
||||
"spec": ">=2.0.0 <2.1.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/npmlog",
|
||||
"/yargs"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"_shasum": "045f9782d011ae9a6803ddd382b24392b3d890f7",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "set-blocking@~2.0.0",
|
||||
"_where": "/mnt/Data/bach/Documents/ola/OLA#4/OLA#4DOC/sys/node_modules/npmlog",
|
||||
"author": {
|
||||
"name": "Ben Coe",
|
||||
"email": "ben@npmjs.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/yargs/set-blocking/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "set blocking stdio and stderr ensuring that terminal output does not truncate",
|
||||
"devDependencies": {
|
||||
"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"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "045f9782d011ae9a6803ddd382b24392b3d890f7",
|
||||
"tarball": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"LICENSE.txt"
|
||||
],
|
||||
"gitHead": "7eec10577b5fff264de477ba3b9d07f404946eff",
|
||||
"homepage": "https://github.com/yargs/set-blocking#readme",
|
||||
"keywords": [
|
||||
"flush",
|
||||
"terminal",
|
||||
"blocking",
|
||||
"shim",
|
||||
"stdio",
|
||||
"stderr"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "bcoe",
|
||||
"email": "ben@npmjs.com"
|
||||
}
|
||||
],
|
||||
"name": "set-blocking",
|
||||
"optionalDependencies": {},
|
||||
"readme": "# set-blocking\n\n[](https://travis-ci.org/yargs/set-blocking)\n[](https://www.npmjs.com/package/set-blocking)\n[](https://coveralls.io/r/yargs/set-blocking?branch=master)\n[](https://github.com/conventional-changelog/standard-version)\n\nset blocking `stdio` and `stderr` ensuring that terminal output does not truncate.\n\n```js\nconst setBlocking = require('set-blocking')\nsetBlocking(true)\nconsole.log(someLargeStringToOutput)\n```\n\n## Historical Context/Word of Warning\n\nThis 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\nnewer versions of Node.js (`0.12+`), truncating terminal output.\n\nYou should be mindful of the side-effects caused by using `set-blocking`:\n\n* if your module sets blocking to `true`, it will effect other modules\n consuming your library. In [yargs](https://github.com/yargs/yargs/blob/master/yargs.js#L653) we only call\n `setBlocking(true)` once we already know we are about to call `process.exit(code)`.\n* this patch will not apply to subprocesses spawned with `isTTY = true`, this is\n the [default `spawn()` behavior](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options).\n\n## License\n\nISC\n",
|
||||
"readmeFilename": "README.md",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/yargs/set-blocking.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "nyc report --reporter=text-lcov | coveralls",
|
||||
"pretest": "standard",
|
||||
"test": "nyc mocha ./test/*.js",
|
||||
"version": "standard-version"
|
||||
},
|
||||
"version": "2.0.0"
|
||||
}
|
||||
Reference in New Issue
Block a user