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

@94ai/arms

v1.0.4

Published

arms、fs、oss、日志监控

Downloads

8

Readme

前言

通用前端监控工具,arms寓意为武器。

阿里arms的api未能自动上报前端js错误,不带js错误分析集成(自行解析错误堆栈),不能自动上传souceMap,需要对接上传和解析

本工具定义为前端监控工具包,目的为多项目公用和后续可扩展为多个错误收集源等。功能包括:

  1. 捕获拦截【全局错误自定义追踪】
  2. 功能扩展【open api封装扩展】
  3. 错误自定义上报【区分环境版本,错误堆栈解析和主动上报】
  4. 分析对接【sourceMap自动上传和分析接入】

特性

  1. 前端js错误捕获追踪自动上报(全局错误拦截)
  2. 堆栈解析上报(借助error-stack-parser
  3. sourceMap自动上传(配合@xccjh/rt-cli@xccjh/rt-core

目前错误上报源只有阿里arms

安装

$ yarn add @xccjh/arms

配置arms默认实例

创建一个管理类做单例管理

// @/utils/alife.js
import store from '@/store'
import envProcess from '@/utils/env'
import { AliArmsManager } from '@xccjh/arms'
import packageJson from '/package.json'

export class AliArms {
  static #getAliArms
  static initAliArms() {
    this.#getAliArms = new AliArmsManager({
      uid: store.getters?.curUser?.uid,
      pid: 'xxxx', // 👈 这是应用pid
      appType: 'web',
      imgUrl: 'https://arms-retcode.aliyuncs.com/r.png?',
      sendResource: true,
      enableLinkTrace: true,
      behavior: true,
      useFmp: true,
      enableSPA: true,
      release: packageJson.version,
      environment: {
        sit: 'local',
        test: 'daily',
        prod: 'prod',
        gray: 'gray'
      }[envProcess.env.ENV_CONFIG]
    })
    return this.#getAliArms
  }
  static getAliArms() {
    return this.#getAliArms ?? this.initAliArms()
  }
  static errReport(err) {
    AliArms.getAliArms().errReport(err)
  }
}

初始化全局错误监听

// @/main.js
import { AliArms } from '@/utils/alife'

AliArms.initAliArms() // 👈 全局js错误自动上报

在框架全局错误钩子或抛错处自行上报

// @/errorLog.js
import { AliArms } from '@/utils/alife'

Vue.config.errorHandler = function(err, vm, info, a) {
  AliArms.errReport(err) // 👈 手动上报
}

后续

新增api链路追踪对接