diff options
Diffstat (limited to 'std/node/_stream/promises.ts')
-rw-r--r-- | std/node/_stream/promises.ts | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/std/node/_stream/promises.ts b/std/node/_stream/promises.ts deleted file mode 100644 index 1adf4ea3f..000000000 --- a/std/node/_stream/promises.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright Node.js contributors. All rights reserved. MIT License. -import pl from "./pipeline.ts"; -import type { PipelineArguments } from "./pipeline.ts"; -import eos from "./end_of_stream.ts"; -import type { - FinishedOptions, - StreamImplementations as FinishedStreams, -} from "./end_of_stream.ts"; - -export function pipeline(...streams: PipelineArguments) { - return new Promise((resolve, reject) => { - pl( - ...streams, - (err, value) => { - if (err) { - reject(err); - } else { - resolve(value); - } - }, - ); - }); -} - -export function finished( - stream: FinishedStreams, - opts?: FinishedOptions, -) { - return new Promise<void>((resolve, reject) => { - eos( - stream, - opts || null, - (err) => { - if (err) { - reject(err); - } else { - resolve(); - } - }, - ); - }); -} |