flatten-stream

0.0.1 • Public • Published

flatten-stream is a lightweight node.js transform stream which flattens a stream of objects.

Basic Usage

const
    streamify=require('stream-array'),
    FlatStreamTransformer=require('./index.js')

const array=[
    [
        {key:'value1'},
        [
            {key:'value2'},
            {key:'value3'}
        ],
    ],
    [
        {key:'value4'}
    ],
    [
        {key:'value5'},
        {key:'value6'},
    ]
];

streamify(array)
    .pipe(new FlatStreamTransformer());

//=>
//[
//  {key:'value1'},
//  {key:'value2'},
//  {key:'value3'},
//  {key:'value4'},
//  {key:'value5'},
//  {key:'value6'}
//]

Package Sidebar

Install

npm i flatten-stream

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • n1tranquilla