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

@log-reporting/core

v1.0.5

Published

前端日志上报SDK

Downloads

19

Readme

文档还在完善中....

🔈 注意事项

本系统的开发目的很简单,就是为了在部分情况下搜集前端的异常日志,用于分析异常情况; 如:线上环境的项目我们会吧一些日志删除,如果前端报错那么日志是首选, 这样的情况我们不知道是哪里的报错导致页面崩溃的; 那么开发这款工具常规情况下能解决大部分的问题;

该版本为全新版本, 与之前的版本会有很大的区别;

🔈 日志搜集范围

  1. 资源:资源地址不正确或不存在导致的资源异常
  2. 代码:搜集报错信息,页面的崩溃等等;
  3. 请求:截请求参数错误,访问地址不存在,异常拦
  4. 额外添加功能:支持录制自定义时间的视频,但是最大时间不能超过1分钟;
  5. 支持性能监控, 白屏时间, 页面加载时间等等;
  6. 支持pv页面浏览, 需要手动提交;
  7. 支持曝光, 需要手动设置对应的元素(仅支持在可是区域内);

🔈 如何使用

需要克隆下载该项目, 执行命令pnpm run build, 之后会在根目录dist文件下看到打包的对应的文件信息; 根据不同平台引入即可;

下面代码示例为浏览器的使用:

<script src="dist/index.umd.js"></script>

<script>
    logReportingCore.init({
        // 上报地址
      dsn: 'http://localhost:8888/postLog',
      // 是否开启调试
      isDebug: true,
      // 是否捕获错误
      isError: true,
      // 是否捕获console.error
      isConsoleError: true,
      // 是否捕获性能
      isPerformance: true,
      // 是否捕获资源
      isResource: true,
      // 是否捕获请求
      isXhr: true,
      // 屏幕录制
      record: {
        open: true,
        time: 10 * 1000
      },
      // 加密方式
      encryptMethod: 'base64',
      // 上报方式
      method: 'beacon',
      // pv统计
      isPv: true,
      // 曝光统计
      isExposure: true
    })
</script>

vue中使用, npm install @log-reporting/core 安装依赖

main.js中引入

import {init} from '@log-reporting/core'
init({})

根据自己的业务需要开启对应的配置信息;