JSPM

pull-traverse

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24421
  • Score
    100M100P100Q163929F
  • License MIT

Package Exports

  • pull-traverse

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-traverse) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

pull-traverse

travis

depthFirst, widthFirst, leafFirst (start, createStream)

Traverse a tree structure. start is a value that represents a node. createStream is a function that returns a pull-stream of the children of a node. start must be the same type output by createStream.

var pull = require('pull-stream')
var pt   = require('pull-traverse')

pull(
  pt.widthFirst(objects, function (object) {
    if(object && 'object' === typeof object)
      return pull.values(object)
    return pull.empty()
  }),
  pull.log()
)

License

MIT