Skip to content

blahah/array-split-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


array-split-stream

a nodeJS transform stream that splits arrays


A nodeJS through2 transform stream that splits incoming arrays, emitting each array entry as a separate data event.

Install

npm install array-split-stream

Usage

var splitter = require('array-split-stream')()

splitter.on('data', function(entry) {
  console.log('entry:', entry)
})

splitter.on('end', function() {
  console.log('done')
})

splitter.write([1, 2, 3])
splitter.write(['orange', 'apple', 'tomato'])
splitter.end()

// entry: 1
// entry: 2
// entry: 3
// entry: orange
// entry: apple
// entry: tomato
// done

License

To the extent possible by law, we transfer any rights we have in this code to the public domain. Specifically, we do so using the CC0 1.0 Universal Public Domain Dedication.

You can do whatever you want with this code. No need to credit us, link to us, include any license, or anything else. But if you want to do those things, you're free to do that too.

About

a nodeJS transform stream that splits arrays

Resources

License

Stars

Watchers

Forks

Packages

No packages published