Socket
Book a DemoInstallSign in
Socket

testable-stream

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

testable-stream

Test your readable/duplex stream results.

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

TestStream

TestStream is a simple Writable stream implementation that bufffers all of the incoming data to be tested against when the stream is finished. This is usefull for readable/duplex/transform stream implementors trying to do end to end testing.

Usage

  // `Hello, World!` is the contents of `file.txt`
  fs.creatReadStream('file.txt')
    .pipe(TestStream())
    .on('testable', function(data) {
      // data -> Buffer('Hello, World!');
    });

  // TestStream also works for `objectMode` streams.
  Model.find({}).stream()
    .pipe(TestStream({objectMode: true}))
    .on('testable', function(data) {
      // data is now an Array of
      // javascript data
    });

Keywords

test

FAQs

Package last updated on 30 May 2015

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