项目作者: coderaiser

项目描述 :
Pipe streams and handle events
高级语言: JavaScript
项目地址: git://github.com/coderaiser/pipe-io.git
创建时间: 2014-03-18T10:12:20Z
项目社区:https://github.com/coderaiser/pipe-io

开源协议:MIT License

下载


Pipe-io License NPM version Dependency Status Build Status Coverage Status

Pipe streams and handle events.

Install

  1. npm i pipe-io

pipe

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

  1. const fs = require('fs');
  2. const pipe = require('pipe-io');
  3. const tryToCatch = require('try-to-catch');
  4. const NAME = 'README.md';
  5. const NAME2 = 'README2.md';
  6. const readStream = fs.createReadStream(NAME);
  7. const writeStream = fs.createWriteStream(NAME2);
  8. const [e] = await tryToCatch(pipe, [readStream, writeStream]);
  • Pullout - pull out data from stream

License

MIT