npm.io
5.1.0 • Published 21h ago

pipe-io

Licence
MIT
Version
5.1.0
Deps
0
Size
14 kB
Vulns
0
Weekly
0
Stars
17

Pipe-io License NPM version ![Dependency Status][DependencyStatusIMGURL] Build Status Coverage Status

Pipe streams and handle events.

Install

npm i pipe-io

pipe

Create pipe between streams and adds callback wich would be called once whenever everything is done, or error occures.

import fs from 'node:fs';
import {pipe} from 'pipe-io';
import {tryToCatch} from 'try-to-catch';

const NAME = 'README.md';
const NAME2 = 'README2.md';
const readStream = fs.createReadStream(NAME);
const writeStream = fs.createWriteStream(NAME2);

const [e] = await tryToCatch(pipe, [readStream, writeStream]);
  • Pullout - pull out data from stream

License

MIT

Keywords