Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

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

Something went wrong with that request. Please try again.