slice-stream

WebJar for slice-stream

Лицензия

Лицензия

MIT
Группа

Группа

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

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

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

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

1.0.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

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

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

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

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

https://github.com/EvanOxfeld/slice-stream

Скачать slice-stream

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

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

Зависимости

compile (1)

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

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

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

slice-stream Build Status

Pipe data through a stream until some fixed length is reached, then callback.

Installation

$ npm install slice-stream

Quick Example

End stream once a fixed length has been reached

var SliceStream = require('../');
var streamBuffers = require("stream-buffers");

var ss = new SliceStream({ length: 5}, function (buf, sliceEnd, extra) {
  if (!sliceEnd) {
    return this.push(buf);
  }
  this.push(buf);
  return this.push(null); //signal end of data
});

var sourceStream = new streamBuffers.ReadableStreamBuffer();
sourceStream.put("Hello World");
var writableStream = new streamBuffers.WritableStreamBuffer();

sourceStream
  .pipe(ss)
  .pipe(writableStream)
  .once('close', function () {
    var str = writableStream.getContentsAsString('utf8');
    console.log('First 5 bytes piped:', "'" + str + "'");
    sourceStream.destroy();
  });

//Output
//Piped data before pattern occurs: 'Hello'

License

MIT

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

Версия
1.0.0