0.1.6 • Published 7 years ago

node-faultline-proto v0.1.6

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

NPM NPM

node-faultline-proto

faultline exception and error notifier for JavaScript.

About

unofficial faultline library for nodejs.
I made this becase I want this.

Installation

Using npm:

npm install node-faultline-proto

Usage

var faultlineJs = require('node-faultline-proto');
var faultline = faultlineJs.createClient({
                  project: 'faultline-js', 
                  apiKey: 'xxxxXXXXXxXxXXxxXXXXXXXxxxxXXXXXX',
                  endpoint: 'https://xxxxxxxxx.execute-api.ap-northeast-1.amazonaws.com/v0',
                  notifications: [
                    {
                      type: 'slack',
                      endpoint: 'https://hooks.slack.com/services/XXXXXXXXXX/B2RAD9423/WC2uTs3MyGldZvieAtAA7gQq',
                      channel: '#random',
                      username: 'faultline-notify',
                      notifyInterval: 1,
                      threshold: 1,
                      timezone: 'Asia/Tokyo'
                    }
                  ]
                });
faultline.notify(new Error("test"));

Integration

handle excptions

The common use case for this module is to catch all 'uncaughtException' events on the process object and send them to Faultline.

var faultlineJs = require('node-faultline-proto');
var faultline = faultlineJs.createClient({
                  project: 'faultline-js', 
                  apiKey: 'xxxxXXXXXxXxXXxxXXXXXXXxxxxXXXXXX',
                  endpoint: 'https://xxxxxxxxx.execute-api.ap-northeast-1.amazonaws.com/v0',
                  notifications: [
                    {
                      type: 'slack',
                      endpoint: 'https://hooks.slack.com/services/XXXXXXXXXX/B2RAD9423/WC2uTs3MyGldZvieAtAA7gQq',
                      channel: '#random',
                      username: 'faultline-notify',
                      notifyInterval: 1,
                      threshold: 1,
                      timezone: 'Asia/Tokyo'
                    }
                  ]
                });
faultline.handleExceptions();
throw new Error("test");

References

License

MIT © Yuta Natsume

0.1.6

7 years ago

0.1.8

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago