How to use the streamx.Readable.from function in streamx

To help you get started, we’ve selected a few streamx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mafintosh / sorted-union-stream / example.js View on Github external
const Union = require('./')
const { Readable } = require('streamx')

const sorted1 = Readable.from([{ key: 'a' }, { key: 'b' }, { key: 'c' }])
const sorted2 = Readable.from([{ key: 'b' }, { key: 'd' }])

const u = new Union(sorted1, sorted2)

u.on('data', function (data) {
  console.log(data)
})

u.on('end', function () {
  console.log('no more data')
})
github mafintosh / sorted-union-stream / example.js View on Github external
const Union = require('./')
const { Readable } = require('streamx')

const sorted1 = Readable.from([{ key: 'a' }, { key: 'b' }, { key: 'c' }])
const sorted2 = Readable.from([{ key: 'b' }, { key: 'd' }])

const u = new Union(sorted1, sorted2)

u.on('data', function (data) {
  console.log(data)
})

u.on('end', function () {
  console.log('no more data')
})

streamx

An iteration of the Node.js core streams with a series of improvements

MIT
Latest version published 2 months ago

Package Health Score

83 / 100
Full package analysis

Similar packages