read-only-stream

WebJar for read-only-stream

Лицензия

Лицензия

MIT
Группа

Группа

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

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

read-only-stream
Последняя версия

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

2.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

read-only-stream
WebJar for read-only-stream
Ссылка на сайт

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

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

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

https://github.com/substack/read-only-stream

Скачать read-only-stream

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

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

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.webjars.npm : readable-stream jar [2.0.2,3)

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

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

read-only-stream

wrap a readable/writable stream to be read-only to prevent mucking up the input side

build status

example

Suppose you have a module that uses a readable/writable stream internally but want to expose just the readable part of that internal stream. This is common if you use the writable side internally and expose the readable side as the interface.

Now we can write some code like this with a through stream internally for convenience:

var through = require('through2');
var readonly = require('read-only-stream');

module.exports = function () {
    var stream = through();
    stream.end('wooooo\n');
    return readonly(stream);
};

but consumers won't be able to write to the input side and break the api:

var wrap = require('./wrap.js');
var ro = wrap(); // can't write to `ro` and muck up internal state
ro.pipe(process.stdout);

methods

var readonly = require('read-only-stream')

var ro = readonly(stream)

Return a readable stream ro that wraps the readable/writable stream argument given to only expose the readable side.

stream can be a streams1 or streams2 stream.

install

With npm do:

npm install read-only-stream

license

MIT

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

Версия
2.0.0
1.1.1