Comparing version 3.0.12 to 4.0.0
@@ -5,5 +5,5 @@ 'use strict'; | ||
const zlib = require('zlib'); | ||
const assert = require('assert'); | ||
const {promisify} = require('util'); | ||
module.exports = (streams, options, callback) => { | ||
module.exports = promisify((streams, options, callback) => { | ||
if (!callback) { | ||
@@ -19,7 +19,4 @@ callback = options; | ||
assert(streams, 'streams could not be empty!'); | ||
assert(callback, 'callback could not be empty!'); | ||
pipe(streams, options, callback); | ||
}; | ||
}); | ||
@@ -129,5 +126,2 @@ function pipe(allStreams, options, callback) { | ||
if (readError && writeOpened) | ||
return onEnd(); | ||
if (readError && !isFsWriteStream) | ||
@@ -134,0 +128,0 @@ return onEnd(); |
{ | ||
"name": "pipe-io", | ||
"version": "3.0.12", | ||
"version": "4.0.0", | ||
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", | ||
@@ -28,3 +28,3 @@ "description": "Pipe streams and handle events", | ||
"engines": { | ||
"node": ">=4" | ||
"node": ">=8" | ||
}, | ||
@@ -47,2 +47,3 @@ "main": "lib/pipe.js", | ||
"tar-fs": "^2.0.0", | ||
"tar-stream": "^2.1.0", | ||
"through2": "^3.0.0", | ||
@@ -49,0 +50,0 @@ "try-to-catch": "^1.0.2" |
@@ -18,4 +18,7 @@ Pipe-io [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL] | ||
```js | ||
const fs = require('fs'); | ||
const pipe = require('pipe-io'); | ||
const fs = require('fs'); | ||
const tryToCatch = require('try-to-catch'); | ||
const NAME = 'README.md'; | ||
@@ -26,5 +29,3 @@ const NAME2 = 'README2.md'; | ||
pipe([readStream, writeStream], (error) => { | ||
console.log(error || 'done'); | ||
}); | ||
const [e] = await tryToCatch(pipe, [readStream, writeStream]); | ||
``` | ||
@@ -31,0 +32,0 @@ |
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
49
13789
17
136