clean-scripts
Advanced tools
Comparing version 1.2.5 to 1.2.6
@@ -10,1 +10,12 @@ "use strict"; | ||
exports.sleep = sleep; | ||
/** | ||
* @public | ||
*/ | ||
function readableStreamEnd(stream) { | ||
return new Promise((resolve, reject) => { | ||
stream.on("end", () => { | ||
resolve(); | ||
}); | ||
}); | ||
} | ||
exports.readableStreamEnd = readableStreamEnd; |
{ | ||
"name": "clean-scripts", | ||
"version": "1.2.5", | ||
"version": "1.2.6", | ||
"description": "A CLI tool to make scripts in package.json clean.", | ||
@@ -32,3 +32,3 @@ "main": "dist/core.js", | ||
"jasmine": "2.8.0", | ||
"no-unused-export": "1.2.5", | ||
"no-unused-export": "1.2.6", | ||
"rimraf": "2.6.1", | ||
@@ -35,0 +35,0 @@ "standard": "10.0.3", |
@@ -121,12 +121,19 @@ [![Dependency Status](https://david-dm.org/plantain-00/clean-scripts.svg)](https://david-dm.org/plantain-00/clean-scripts) | ||
##### short-hand sleep | ||
##### short-hand methods | ||
```js | ||
const { sleep } = require('clean-scripts') | ||
const { sleep, readableStreamEnd } = require('clean-scripts') | ||
module.exports = { | ||
build: [ | ||
() => sleep(5000) | ||
() => sleep(5000), | ||
async () => { | ||
const readable = getReadableStreamSomehow() | ||
readable.on('data', chunk => { | ||
console.log(`Received ${chunk.length} bytes of data.`) | ||
}) | ||
await readableStreamEnd(readable) | ||
} | ||
] | ||
} | ||
``` |
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
9910
137
139