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

@umengfe/apm

v2.0.11

Published

友盟web|H5性能分析、错误追踪sdk

Downloads

124

Readme

在终端执行如下命令安装 sdk

npm install @umengfe/apm --save

ESM

import { init } from '@umengfe/apm';
init({
  pageFilter: { mode: 'ignore', rules: [] },
  pkgList: ['com.uemng.apmios', 'com.umeng.apmandroid'],
});

api 说明

init

初始化方法,调用示意

import { init } from '@umengfe/apm';
init({
  pageFilter: {
    mode: 'ignore',
    rules: ['https://www.umeng.com'],
  },
  pkgList: ['com.uemng.apmios', 'com.umeng.apmandroid'],
});

参数说明

pageFilter

非必须参数,用于根据页面地址判断是否过滤日志,包含如下属性

| 属性 | 含义 | 默认 | 类型 | | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | --------------------------------------------------------------------- | | mode | 匹配模式,当值为 ignore,表示黑名单模式,命中规则的不上报 、当值为 match,表示白名单模式命中规则的上报 | ignore | 枚举值 ignore|match | | rules | 匹配规则集合,当类型为 string 时,表示包含当页面 URL 包含该字符串时命中规则;当类型为 Funtion,该函数返回 true 表示命中规则,false 表示未命中规则;当类型为数组时,表示规则集合,规则之间为或的关系,只要任意一个规则命中,则规则集命中。 | [],该默认值表示黑名单为空,日志全部上报 | string \| RegExp \| Function \| Array<string \| RegExp \| Function> |

pkgList

当需要打通 native 端时为必填参数。 当且仅当在 native 端集成友盟 APM sdk,且版本大于<1.6.0>时生效,表示允许通过 native 发送日志的应用包名称,是一个字符串数组

| 属性 | 含义 | 默认 | 类型 | | ------- | -------------------------------------------------------------------------- | ------------------------------------- | -------------------------------------------------------------------------------------- | | pkgList | 通过 native 发送日志的应用包名称白名单集合,如有多个包名称,用英文逗号分隔 | '' 表示包名称地址为空,默认不发送日志 | string 或者 数组 举例 'com.umeng.com,com.apm.com' 或者 ['com.umeng.com','com.apm.com'] |

logLevel

非必填,表示 js 日志输出日志等级

| 属性 | 含义 | 默认 | 类型 | | -------- | -------- | ---- | --------------------------------------------------------------------------- | | logLevel | 日志等级 | 0 | 枚举值 0 表示 ERROR 日志1 表示 WARN 日志2 表示 INFO 日志3 表示 DEBUG 日志 |