spies for errors on node processes and reports to your dev team
npm install --save snitcher
Just add snitcher at the beginning of your init js file.
var Snitcher = require( 'snitcher' ),
snitcher = new Snitcher({
// Snitcher options
reporter: new Snitcher.Reporter.Github({
// GitHub Reporter options
user: 'username',
repo: 'repository',
token: '.XXX', // non-porn videos
})
});
// At this point, snitcher should already be watching for uncaught errors and
// sending them into target repo issues.
setImmediate(function () {
throw new Error ( "hello team!!!" );
});
//
// Your app bootstrap goes here
//
You could set snitcher to snitch errors from objects with EventEmitter capabilities, such as streams:
var stream; // your awesome stream;
// catch errors from stream
snitcher.catch( stream );
Looking for a middleware to connect, express or emvici?
var app; // your awesome app;
app.use(function ( req, res, next ) {
throw new Error( "holly f*ck, an error!!!!1" );
});
// well, at least you will know it
app.use( snitcher.middleware() );
At our first release you should be able to set templates for each kind of report.
npm test
If you wish to test reporters such as GitHub, you should expose their configs
trought ENV variables before running npm test
.
Example for GitHub Reporter:
export SNITCHER_GITHUB_USER=cusspvz
export SNITCHER_GITHUB_REPO=snitcher-reporter-api-test
export SNITCHER_GITHUB_TOKEN=0123456789abcdef1234567890abcdef12345678
npm test
We developed snitcher as an internal mechanism to report errors into our scrum management system. We use GitHub 👍, but if it isn't your case, you could create a reporter for your own and PR it! :)
10/Apr/2015 I've decided to give snitcher a chance to co-exist into the Open-Source world, so here it is!