ats

array-to-stream

convert an array into an object stream

Showing:

Popularity

Downloads/wk

14

GitHub Stars

0

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

1

Size (min+gzip)

7.9KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

var ArrayToStream = require('array-to-stream')
var assert = require('assert')

var array = [1, false, {x: '10'}]

var emitted = []
var ended = false

new ArrayToStream(array)
  .on('data', function (object) {
    emitted.push(object)
  })
  .on('end', function () {
    assert.deepEqual(emitted, array)
    ended = true
  })

process.on('exit', function () {
  assert.equal(ended, true)
})

assert.throws(function () {
  new ArrayToStream(['x', null, 'y'])
}, /Object streams cannot emit `null`/)

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100