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

lz-monitor-sdk

v1.0.10

Published

monitor-sdk

Downloads

5

Readme

jsdoc 自动生成文档

commit规则

  • feat 新特性、新功能
  • fix 修改bug
  • docs 文档修改
  • style 代码格式修改, 注意不是 css 修改
  • refactor 代码重构
  • perf 优化相关,比如提升性能、体验
  • test 测试用例修改
  • chore 其他修改, 比如改变构建流程、或者增加依赖库、工具等
  • revert 回滚到上一个版本
  • build 编译相关的修改,例如发布版本、对项目构建或者依赖的改动

安装

 npm i lz-monitor-sdk

配置

在main.js中导入并创建monitorSDK实例,实例参数

  • reportUrl 上报地址
  • appName 项目名称
  • httpWhiteList http请求白名单
  • errorConfig 错误信息配置
    • isJsError (是否开启js错误监控)
    • isPromiseError (是否开启Promise错误监控)
    • isResourceError (是否开启静态资源错误监控)
  • isHttpRequest http请求白名单 (是否开启HTTP请求监控)
  • isPerformanceCollect 是否开启性能监控
import monitorSDK from 'lz-monitor-sdk'
const monitor = new monitorSDK({
  reportUrl: 'http://localhost:3000/addLog',
  appName: 'H5',
  httpWhiteList: ['maidian/log'],
  errorConfig:{
    isJsError: true,
    isPromiseError: true,
    isResourceError: true
  },
  isPerformanceCollect:true,
  isHttpRequest:true
})

方法

  • updateBaseConfig 更新上报数据
  • loadErrorConfig 错误监控配置加载
  • loadPerformanceConfig 性能监控配置加载
  • loadHttpConfig http请求数据配置加载
monitor.updateBaseConfig()

监控API

  • errorTracker 错误信息上报
  • httpTracker 接口请求信息上报
  • performanceTracker 性能监控信息上报