ptrace

easily trace execution order of your promise-based program

ptrace

easily trace execution order of your promise-based program

function getUser(userId) {
  return minq.from('users').byId(userId).expect().one()
}

// pass a label, a promise-returning function, and arguments:
ptrace('getUser', getUser, 23).then(function (user) {
  // do stuff
})

Console output:

1 invoking getUser ( 23 )
1 resolved {id: 23, name: 'jden' }

using jsig notation

trace invocations of a promise-returning function, logging messages on invocation and resolution/rejection

Logging function to use. Defaults to console.log. If you'd like, override with your own logging function of signature (str: String) => void

Boolean, defaults to false. If false, logging will only occur if process.env.DEBUG is truthy. Override this flag to a truthy value to force logging.

$ npm install ptrace

From package root:

$ npm install
$ npm test

jden jason@denizac.org

MIT. (c) 2013 jden jason@denizac.org. See LICENSE.md