async-depth-first

1.0.3 • Public • Published

async-depth-first

Depth first traversal for recursive, asynchronous JavaScript functions.

Build Status

npm install async-depth-first
var depthFirst = require('async-depth-first')
 
var q = depthFirst()
q.defer(function (cb) {
  console.log('1')
  q.defer(function (cb) {
    console.log('1.1')
    q.defer(function (cb) {
      console.log('1.1.1')
      cb()
    })
    cb()
  })
  q.defer(function (cb) {
    console.log('1.2')
    cb()
  })
  cb()
})
q.defer(function (cb) {
  console.log('2')
  cb()
})
q.done(function (err) {
  console.log('done')
})

Outputs

1
1.1
1.1.1
1.2
2
done

License

MIT

Dependents (1)

Package Sidebar

Install

npm i async-depth-first

Weekly Downloads

19

Version

1.0.3

License

MIT

Last publish

Collaborators

  • cshum