Socket
Book a DemoInstallSign in
Socket

write-transform-read

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

write-transform-read

Write to a transform stream and read the output using a function

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

write-transform-read

Write to a transform stream and read the output using a function

npm install write-transform-read

build status dat

Usage

var writeread = require('write-transform-read')
var through = require('through2')

var echo = through.obj(function(data, enc, cb) {
  cb(null, {echo:data})
})

// simply pass any kind of transform stream
var transform = writeread(echo)

// will write 'test' to the stream and pass the next output to the callback
transform('test', function(err, result) {
  console.log(result) // will print {echo:'test'}
})

This is useful if you have a transform as a stream but need to only convert a single item

License

MIT

Keywords

write

FAQs

Package last updated on 03 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts