New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

bugflux

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

bugflux

Bugflux reporting library for Node.js

latest
npmnpm
Version
1.0.4
Version published
Weekly downloads
7
-36.36%
Maintainers
1
Weekly downloads
 
Created
Source

Bugflux reporting library

Still under development, subscribe at project homepage to be up to date.

Installation and basic usage

Install package by running npm install bugflux --save.

By default all uncaught exceptions are sent to bugflux server, the only thing you have to do is to set the default configuration:

var bugflux = require('bugflux');

bugflux.setDefault({
    url: 'https://bugflux.your-domain.com/',
    project: 'Your project name',
    version: '0.1.0',
    language: 'en_US',
    environment: 'Production',
});

console.log(bugflux.default.project); // <-- Print "Your project name"
throw new Error(); // <-- Report will be sent here

You can disable it by setting bugflux.options.sendUncaughtExceptions to false.

Options

All global settings can be found at bugflux.options.*:

  • silent - Disable priting error message to standard error stream when uncaught exception occurs (default false);
  • sendUncaughtExceptions - Enable automatic error reporting when uncaught exception occurs (default true).
  • strictSSL - Force to use https protocol and verified certificates (default true, we do not recommend changing this value, but you can use it for testing or developing purposes).

Reporting manually

You can send reports manually by calling send method:

var bugflux = require('bugflux');

fn(args, function(err) {
    if(err) bugflux.send(err); // <-- Use default settings
});

The send method accept bugflux.report, raw Object or Error:

// 1. bugflux.report
var report = new bugflux.report(new Error());
// - or -
var report = new bugflux.report(new Error(), { project: 'Custom project name'});
// - or -
var report = new bugflux.report({ project: 'Awesome project name' });
    report.fill(new Error()); // <-- Fill error details (hash, name, stack_trace)

bugflux.send(report);
// 2. Object
bugflux.send({
    url: 'https://bugflux-server/',
    project: 'Awesome project name',
    // and more... see bugflux.com/api/report-an-error.html
});
// 3. Error
bugflux.send(new Error('test'));

Server response

The send method accept callback as a second argument. The callback parameters are forwarded from request method.

var bugflux = require('bugflux');

bugflux.send(new Error(), function(err, res, body) {
    console.log(err, res, body);
});

Keywords

bugflux

FAQs

Package last updated on 21 Nov 2016

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