cloneable-readable

WebJar for cloneable-readable

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

cloneable-readable
Последняя версия

Последняя версия

1.1.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

cloneable-readable
WebJar for cloneable-readable
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/mcollina/cloneable-readable

Скачать cloneable-readable

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/cloneable-readable/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>cloneable-readable</artifactId>
    <version>1.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/cloneable-readable/
implementation 'org.webjars.npm:cloneable-readable:1.1.3'
// https://jarcasting.com/artifacts/org.webjars.npm/cloneable-readable/
implementation ("org.webjars.npm:cloneable-readable:1.1.3")
'org.webjars.npm:cloneable-readable:jar:1.1.3'
<dependency org="org.webjars.npm" name="cloneable-readable" rev="1.1.3">
  <artifact name="cloneable-readable" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='cloneable-readable', version='1.1.3')
)
libraryDependencies += "org.webjars.npm" % "cloneable-readable" % "1.1.3"
[org.webjars.npm/cloneable-readable "1.1.3"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.webjars.npm : inherits jar [2.0.1,3)
org.webjars.npm : process-nextick-args jar [2.0.0,3)
org.webjars.npm : readable-stream jar [2.3.5,3)

Модули Проекта

Данный проект не имеет модулей.

cloneable-readable

Greenkeeper badge

Build Status

Clone a Readable stream, safely.

'use strict'

var cloneable = require('cloneable-readable')
var fs = require('fs')
var pump = require('pump')

var stream = cloneable(fs.createReadStream('./package.json'))

pump(stream.clone(), fs.createWriteStream('./out1'))

// simulate some asynchronicity
setImmediate(function () {
  pump(stream, fs.createWriteStream('./out2'))
})

cloneable-readable automatically handles objectMode: true.

This module comes out of an healthy discussion on the 'right' way to clone a Readable in https://github.com/gulpjs/vinyl/issues/85 and https://github.com/nodejs/readable-stream/issues/202. This is my take.

YOU MUST PIPE ALL CLONES TO START THE FLOW

You can also attach 'data' and 'readable' events to them.

API

cloneable(stream)

Create a Cloneable stream. A Cloneable has a clone() method to create more clones. All clones must be resumed/piped to start the flow.

cloneable.isCloneable(stream)

Check if stream needs to be wrapped in a Cloneable or not.

Acknowledgements

This project was kindly sponsored by nearForm.

License

MIT

Версии библиотеки

Версия
1.1.3
1.1.2