npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@hfaxjs/bug-report

v1.0.1

Published

hfax bug report plugin

Downloads

5

Readme

Introduce

@hfaxjs 错误上报插件,原则上每个外部项目需要集成。 项目初创滴滴王晨雨<[email protected]>申请apikey。

Getting Started

需要安装@hfaxjs/core 核心库


cnpm install @hfaxjs/core --save
cnpm install @hfaxjs/bug-report --save

Usage


import hfax from '@hfaxjs/core';
import bugReport from '@hfaxjs/bug-report';
import Vue from 'vue';

hfax.use(bugReport, {
  apikey: process.env.VUE_APP_HFAXJS_BUGREPORT_APIKEY, //必填
  releasestage: process.env.NODE_ENV,
  isVue: true  //当使用vue框架时,需要第三个参数传入Vue实例
}, Vue)

// test 
hfax.bugReport.notify('Test', 'it works!') //测试,生效需要删除

Configuration


export interface bugReportConfig{
    apikey: string;  //必填,apikey
    appversion?: string; //app 应用指定版本
    releasestage?: string; //环境区分 development test production
    user?: string;  //用户属性 可忽略
    metaData?: object; //可以通过metaData收集所需要的信息 见doc https://docs.fundebug.com/notifier/javascript/customize/metadata.html
    callback?: Function;    //错误回到上报到其他数据平台(暂无)
    setHttpBody?: boolean;
    httpTimeout?: number;
    filters?: object[];
    silent?: boolean;  //
    silentDev?: boolean; //开发阶段不报错
    silentResource?: boolean;
    silentHttp?: boolean;
    silentWebsocket?: boolean;
    silentConsole?: boolean;
    silentPerformance?: boolean;
    sampleRate?: number;
    domain?: string;
    //hfax 扩展字段 
    isVue?:boolean; //是否是vue框架,需要加载时候传入Vue实例
}

Api

notify(name, message, option)

使用 hfax.bugReport.notify()方法,可以将自定义的错误信息发送到错误平台

name: 错误名称,参数类型为字符串

message: 错误信息,参数类型为字符串

option: 可选对象,参数类型为对象,用于发送一些额外信息,比如:

  • metaData: 其他自定义信息

示例:

1.不带 metaData

  hfax.bugReport.notify("Test", "Hello, Fundebug!");

2.带 metaData

   hfax.bugReport.notify("Test", "Hello, Fundebug!", {
        metaData: {
            company: "云麒",
            location: "厦门"
        }
    });

notifyError(error, option)

使用 notifyError()方法,可以将主动捕获的错误发送到 Fundebug

error:抛出的错误对象,参数类型为Error

option:可选对象,参数类型为对象,用于发送一些额外信息,比如:

  • metaData: 其他自定义信息

例子同 notify

hfax.bugReport.notifyError()上报的错误的类型"caught",即type属性的值为"caught"。

Version

current version:1.0.1

Update

2019-10-22 version 1.0.1 修复构建错误 2019-10-22 version 1.0.0-stable