0.2.2 • Published 10 years ago

through2-sync v0.2.2

Weekly downloads
7
License
Unlicense
Repository
github
Last release
10 years ago

through2-sync npm version

Synchronous through2 transforms.

Description

The API is the same as through2 (including the through.obj helper), but the callback function is synchronous.

Example

const Stream = require('stream')
const through = require('through2-sync')

const stream = new Stream.Readable()
stream._read = () => {}

stream
  .pipe(through(
    chunk => chunk.toString().toUpperCase(),
    () => 'last chunk\n'
  ))
  .pipe(process.stdout)

stream.push('hello\n') // HELLO
stream.push('world\n') // WORLD
stream.push(null) // last chunk
0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago