through2-sync
0.2.2 • Public • Published through2-sync 
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')
stream.push('world\n')
stream.push(null)
/through2-sync/
//
Package Sidebar
Install
Weekly Downloads