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

@fairteam/trace

v0.0.38

Published

## Quick introduce

Downloads

7

Readme

trace-sdk-for-fair-web

Quick introduce

功能

提供以下全局的采集类型

  • 脚本错误
  • 网络错误,ajax & fetch
  • 点击事件
  • url change
  • performance 数据
  • device 数据
  • 自定义通过 createEvent 上传,待完善

使用

import { BrowserClient } from 'trace-sdk-for-fair-web'

export const traceInstance = BrowserClient.setup({
  appType: 'web',
  // 是否禁止click & url change的收集
  disableCaptureAction: true,
  // 是否禁用scripr error
  disableCaptureScript: false,
  // 是否禁用netwrok error
  disableCaptureNetwork: false
})

发包

npm run build

npm version patch

npm publish

目录结构

.
├── dist
│ ├── index.js // 打包文件
├── package-lock.json
├── package.json
├── readme.md
├── rollup.config.js // 打包配置文件
├── src
│ ├── action.js // action类
│ ├── browser // 浏览器内utils
│ │ ├── capture // 劫持浏览器原生方法,部分行为addAction
│ │ ├── dispatch // 事件分发,供capture调用,dispatch通过eventType类型调用不同的handler
│ │ ├── handle // createEvent & notify,事件上报
│ ├── config
│ │ ├── configSchema.js // setup config validate schema,not implement yet
│ │ ├── eventType.js // 事件类型分类
│ ├── data
│ │ ├── schema_ex1.jsonc // 前端上传json数据 demo data,未同步
│ │ └── table_ex1.jsonc // clickhouse table header data
│ ├── device.js // device数据
│ ├── event.js // event类,字段需要重新整理
│ ├── index.js // client类,以及初始化方法
│ ├── notify.js // 上传数据的实现sendBeacon & XMLHttpRequest
│ ├── peformance.js // performance数据和web-vitals数据
│ ├── table
│ │ └── trace.sql // click 表初始化sql语句,表头字段已改变
│ ├── utils
│ │ ├── cookie.js // cookie utils
│ │ ├── errorHandler.js // error handle utils
│ │ ├── get.js // get utils
│ │ ├── index.js // utils entry
│ │ ├── uuid.js // get traceid by uuid
│ │ ├── validator.js // validate utils
│ │ └── web-vitals // web-vitals package
│ └── verifyConfig.js // not implement yet