🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

bugnet

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bugnet

Capture bugs.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

bugnet

Capture Javascript errors. Minimal version of rollbar, bugsnag, etc.

build status coverage license version downloads

Usage

Simply pass the function you wish to use for being notified of errors. As soon as you include bugnet in your application errors will start to be captured and buffered until they're ready to be consumed later. It is recommended you include bugnet as soon as possible in your application.

Importantly bugnet will NOT squelch your application errors (i.e. not a silent catch-all) - it simply monitors them.

npm install --save bugnet
import capture from 'bugnet';

capture((error) => {
	// ...
});

Examples

Browser

Send browser errors to an off-site logger:

import capture from 'bugnet';

// Add event handler.
capture((error) => {
	const request = new XMLHttpRequest();
	request.open('http://errors.myapp.com/', 'POST', true);
	request.send(JSON.stringify(event));
});

Node

Send node.js errors to the console:

// example.js
import capture from 'bugnet';

// Add event handler.
capture((error) => {
	console.log('Got error', error);
});

To start capturing errors at the earliest possible point, load bugnet from node itself.

#!/bin/sh
node -r bugnet ./example.js

TODO:

  • Testing
  • Fix incompatibilities using Object.* methods

FAQs

Package last updated on 15 Aug 2017

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