🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

bunyan-promise

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bunyan-promise

Bunyan formatted tracking of outstanding promises, progress, errors, and resolution times.

0.1.4
latest
Source
npm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Bunyan-Promise

Bunyan-Promise consumes promises and outputs bunyan logs showing their progress, their resolution or rejection, and makes state dumps showing all promises that have not settled.

How?

Bunyan-Promise can consume any type of promises, but for the sake of this example we'll use one from Kriskowal's Q Library.

var q = require('q');
var BunyanPromiseLogger = require('bunyan-promise');
var logger = new BunyanPromiseLogger({
  name: 'test-logger'
});
var defer = q.defer();
logger.trace(defer.promise, 'arbitrary promise name for logging');

// sometime in the future resolve that promise
setTimeout(function () {
  defer.resolve();
}, 10000);

Example output

This is pretty printed by piping the output through the bunyan cli.

node app.js | bunyan -o short

Alternatively you can use the bunyan grunt task if you're using grunt

npm install --save-dev grunt-bunyan
grunt bunyan task1 task2 ...

Keywords

bunyan

FAQs

Package last updated on 09 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts