Skip to content

Flat-stream-transformer is a lightweight node.js Transform stream which flattens an input stream consisting of an array of any objects, outputting a flattened stream of the input array

n1tranquilla/node-flat-stream-transformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'}
//]

About

Flat-stream-transformer is a lightweight node.js Transform stream which flattens an input stream consisting of an array of any objects, outputting a flattened stream of the input array

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published