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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@falcontracker/report-plugin

v0.0.1

Published

将 [@falcontracker/sdk](https://github.com/falconTracker/sdk) 收集的信息适配成支持 [report-service](https://github.com/falconTracker/report-service) 接口。

Readme

@falcontracker/report-plugin

@falcontracker/sdk 收集的信息适配成支持 report-service 接口。

安装

npm i @falcontracker/report-plugin --save-dev

接入到 sdk 中

import { init } from '@falcontracker/sdk';
import { createFalconReportPlugin } from '@falcontracker/report-plugin';

init({
    appId: 'xxxx',
    plugins: [ createFalconReportPlugin() ]
})

数据示例

这个插件的作用就是将 @falcontracker/sdk 收集上来的数据进行转换,适配 falcontracker/report-service 服务。

页面性能数据示例

{
  appId: 'xxx',
  time: 12345678,
  reportType: 1,
  markUser: 'ISq8gNXMBv1740628511799',
  markUv: '5wAVeIdMXt1740628511799',
  markPage: 'gt3E7cFACa1740641321522',
  url: 'http://xxx.com/b',
  pre_url: 'http://xxx.com/a',
  performance: {
    lodt: 0,
    dnst: 0,
    tcpt: 0,
    domt: 0,
    wit: 0,
    rdit: 0,
    uodt: 0,
    reqt: 0,
    andt: 0,
    radt: 0,
  },
  resourceList: [
    {
      initiatorType: 'script',
      resourceUrl: 'http://xxx.com/index.js',
      duration: 0,
      decodedBodySize: 1024,
      nextHopProtocol: 'http/1.1',
      responseStatus: 0,
    },
  ],
  metricLis: [
    {
      name: 'TTFB',
      rating: 'good',
      value: 14,
    },
  ],
}

web-vitals 指标上报

{
  appId: 'xxx',
  time: 12345678,
  reportType: 1,
  markUser: 'ISq8gNXMBv1740628511799',
  markUv: '5wAVeIdMXt1740628511799',
  markPage: 'gt3E7cFACa1740641321522',
  url: 'http://xxx.com/b',
  metricList: [
    {
      name: 'TTFB',
      rating: 'good',
      value: 14,
    },
  ],
}

请求数据示例

{
  appId: 'xxx',
  time: 12345678,
  reportType: 2,
  markUser: 'usertokenxxx',
  markUv: 'uniqueIdxxx',
  markPage: 'gt3E7cFACa1740641321522',
  url: 'http://xxx.com/b',
  requestList: [
    {
      resourceUrl: 'http://xxx.com/api',
      method: 'GET',
      duration: 10,
      decodedBodySize: 1024,
      params: ``,
      status: 200,
      statusText: 'OK',
      message: '{"code":401,"msg":"登录状态已过期"}',
    },
  ],
};

js 错误

普通的 js 错误以及 unhandledrejection 错误。

{
  appId: 'xxx',
  time: 12345678,
  reportType: 3,
  markUser: 'ISq8gNXMBv1740628511799',
  markUv: '5wAVeIdMXt1740628511799',
  markPage: 'gt3E7cFACa1740641321522',
  url: 'http://xxx.com/b',
  errorList: [
    {
      traceId: '"f6042464-3713-426c-b61a-4cbf8e86a0b5"',
      msg: 'con is not defined',
      n: 'js',
      t: 12345678,
      data: {
        line: 1,
        col: 1,
        resourceUrl: 'http://xxx.com/index.js',
      },
      behaviorList: [
        // 点击
        {
          type: 'ui-click',
          traceId: '"f6042464-3713-426c-b61a-4cbf8e86a0b5"',
          data: {
            chain: 'div#id.className1.className2',
          },
          timeStamp: 12345678,
        },
        // 发送请求
        {
          type: 'request',
          traceId: '"f6042464-3713-426c-b61a-4cbf8e86a0b5"',
          data: {
            resourceUrl: 'http://xxx.com/api',
            method: 'GET',
            duration: 10,
            decodedBodySize: 1024,
            params: ``,
            status: 200,
            statusText: 'OK',
            message: '{"code":401,"msg":"登录状态已过期"}',
          },
          timeStamp: 12345678,
        },
        // 导航
        {
          type: 'navigation',
          traceId: '"f6042464-3713-426c-b61a-4cbf8e86a0b5"',
          data: {
            from: 'http://xxx.com/b',
            to: 'http://xxx.com/c',
          },
          url: 'http://xxx.com/b',
          timeStamp: 12345678,
        },
      ],
    },
  ],
};

@falcontracker/report-plugin 会将用户行为进行收集,不会直接上报,等到出现错误时才会将全部用户行为进行与错误一起上报,用于方便回溯错误的产生。

资源加载错误

{
  appId: 'xxx',
  time: 12345678,
  reportType: 3,
  markUser: 'ISq8gNXMBv1740628511799',
  markUv: '5wAVeIdMXt1740628511799',
  markPage: 'gt3E7cFACa1740641321522',
  url: 'http://xxx.com/b',
  errorList: [
    {
      traceId: 'traceIdxxx',
      msg: 'The resource imported through script tag failed to load',
      n: 'resource',
      t: 12345678,
      data: {
        target: 'script',
        resourceUrl: 'http://xxx.com/wrong.js',
      },
    },
  ],
}

请求错误数据示例

{
  appId: 'xxx',
  time: 12345678,
  reportType: 2,
  markUser: 'ISq8gNXMBv1740628511799',
  markUv: '5wAVeIdMXt1740628511799',
  markPage: 'gt3E7cFACa1740641321522',
  url: 'http://xxx.com/b',
  errorList: [
    {
      traceId: '"789c39e7-1c7e-43d9-9134-12c5f13af724"',
      msg: 'error',
      n: 'request',
      t: 12345678,
      data: {
        resourceUrl: 'http://xxx.com/api/',
        method: 'POST',
        duration: 0,
        decodedBodySize: 0,
        params: `{name: 'leo', password: '123'}`,
        status: -1,
        statusText: 'error',
        message: 'Failed to request',
      },
    },
  ],
}