stream-read-all
Advanced tools
Comparing version 0.1.2 to 1.0.0
@@ -50,6 +50,4 @@ 'use strict' | ||
}) | ||
streamReader.on('error', (err) => { | ||
reject(err) | ||
}) | ||
streamReader.on('error', reject) | ||
}) | ||
} |
{ | ||
"name": "stream-read-all", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "0.1.2", | ||
"description": "stream-read-all", | ||
"version": "1.0.0", | ||
"description": "Returns a promise which resolves once all data in the supplied stream has been read", | ||
"repository": "https://github.com/75lb/stream-read-all.git", | ||
@@ -18,13 +18,13 @@ "keywords": [ | ||
"engines": { | ||
"node": ">=4" | ||
"node": ">=6" | ||
}, | ||
"scripts": { | ||
"test": "test-runner test/*.js", | ||
"cover": "istanbul cover ./node_modules/.bin/test-runner test/*.js && cat coverage/lcov.info | ./node_modules/.bin/coveralls && echo" | ||
"cover": "nyc --reporter=text-lcov npm test | coveralls" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"coveralls": "^2.13.1", | ||
"test-runner": "^0.4.0" | ||
"coveralls": "^3.0.1", | ||
"test-runner": "^0.5.0" | ||
} | ||
} |
@@ -10,11 +10,24 @@ [![view on npm](https://img.shields.io/npm/v/stream-read-all.svg)](https://www.npmjs.org/package/stream-read-all) | ||
Returns a promise which resolves once all data has been read. | ||
Returns a promise which resolves once all data in the supplied stream has been read. | ||
This example script... | ||
```js | ||
const stream = fs.createReadStream('./package.json') | ||
const data = await streamReadAll(stream) | ||
async function printInput () { | ||
const streamReadAll = require('stream-read-all') | ||
const stdin = await streamReadAll(process.stdin) | ||
console.log(stdin.toString()) | ||
} | ||
printInput() | ||
``` | ||
...prints this output. | ||
``` | ||
$ echo Hello | node example.js | ||
Hello | ||
``` | ||
* * * | ||
© 2017 Lloyd Brookes <75pound@gmail.com>. | ||
© 2017-18 Lloyd Brookes <75pound@gmail.com>. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
51517
17
549
1
32