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 🙏

© 2024 – Pkg Stats / Ryan Hefner

se-report

v0.0.1

Published

report js error to your log-server

Downloads

3

Readme

se-report -- 浏览器端sdk

前端日志上报与JS异常监控

Getting Started

se-report 必须在所有js前加载并初始化。

引入se-report

支持script以及模块化引入

<script src="//yun.tuipink.com/wawaji/se/se-report.0.1.0.min.js"></script>
初始化
SE_REPORT.init({
  pid: 'wawah5'                          // 不指定 id 将不上报
});
查看数据
  1. LogInsight查看 http://log-vpc.dui88.com/streams
  2. 页面直接查看 http://retcode.tuipink.com/debug

配置说明

BJ_REPORT.init({
  pid: 'wawah5',                        // 上报 id, 不指定 id 将不上报
  delay: 1000,                          // 当 combo 为 true 可用,延迟多少毫秒,合并缓冲区中的上报(默认)
  url: "//retcode.tuipink.com",         // 指定上报地址
  ignore: [/Script error/i],            // 忽略某个错误
  random: 1,                            // 抽样上报,1~0 之间数值,1为100%上报(默认 1)
  repeat: 5,                            // 重复上报次数(对于同一个错误超过多少次不上报)
                                        // 避免出现单个用户同一错误上报过多的情况
  ext: {}                               // 扩展属性,支持收集自定义数据
});
ext扩展
ext: {
  params: ['a_tuiaId', 'mediaId'],
  roomId: function() { return window.CFG.roomId; }
}

SE_Report 是重写了 window.onerror 进行上报的,无需编写任何捕获错误的代码

手动上报
SE_REPORT.report("error msg");

SE_REPORT.report({
  msg: "xx load error",                 // 错误信息
  target: "xxx.js",                     // 错误的来源js
  rowNum: 100,                          // 错误的行数
  colNum: 100,                          // 错误的列数
});

try{
    // something throw error ...
}catch(error){
    SE_REPORT.report(error);
}