JSPM

pull-flatten-deep

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q15539F
  • License MIT

Pull-stream which recursively flattens streams of streams

Package Exports

  • pull-flatten-deep

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pull-flatten-deep) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

pull-flatten-deep

npm version build status test coverage downloads js-standard-style

Pull-stream which recursively flattens streams of streams.

Usage

const pull = require('pull-stream')
const flattenDeep = require('pull-flatten-deep')

 pull(
  pull.values([1, 2, pull.values([3, 4, pull.values([5, 6]), 7, 8, pull.values([9, 10, pull.values([11, 12])])])]),
  flattenDeep(),
  pull.collect(function (err, all) {
    console.log(all.toString() === [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].toString())
    // true
  })
)

API

flattenDeep

Usage: pull(source, flattenDeep(), sink)

Provides a pull stream through which flattens nested streams, and like pull.flatten, runs them sequentially.

Installation

$ npm install pull-flatten-deep

Acknowledgement

This function is heavily based on [dominictarr]'s original pull.flatten. Imitation is the sincerest form of flattery.

License

MIT dominictarr