@futagoza/create-stream

1.0.0 • Public • Published

This package provides helpers to create through2 streams from different types of functions.

const cs = require( "@futagoza/create-stream" );

// Create's a through2 stream from the given Promise or Function,
// passing the extra arguments fn if it's not a Promise.
cs( fn, ...args )
cs.createStream( fn, ...args )
cs.from( fn, ...args )

// Create's a through2 stream from the given Promise, passing the
// optional options object directly to through2.
cs.fromPromise( fn, options? )

// Create's a through2.obj tranform stream using the given function,
// passing the optional array of extra arguments to fn.
cs.fromFunction( fn, args? )

// Aliases for through, so it doesn't have to be included separately.
cs.through
cs.through2
cs.ctor
cs.obj

History license

@futagoza/create-stream is Copyright (c) 2018+ Futago-za Ryuu

/@futagoza/create-stream/

    Package Sidebar

    Install

    npm i @futagoza/create-stream

    Weekly Downloads

    5

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    5.55 kB

    Total Files

    6

    Last publish

    Collaborators

    • ryuu