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 🙏

© 2025 – Pkg Stats / Ryan Hefner

eft-sentry

v0.1.3

Published

 

Downloads

19

Readme

eft-sentry

 

Install

npm install eft-sentry  --save

# or

yarn add eft-sentry

 

Use

| Export Module | Quick Link | | :-----------: | :------------------: | | Vue | Jump | | Vanilla | Jump | | React | Jump | | React Native | Jump | | Souce Map | Jump |

 

Vue

// 默认情况是Vue3
import { SentryVue } from 'eft-sentry'
import { createApp} from 'vue'
import router from "./router";
const app = createApp(...);
// 直接实例化可以获得更好的类型支持
new SentryVue({
    app,
    router,
    env: process.env,
    config: {
        dsn: "xxxx",
        Blacklist: [],
    }
})
// 为vue的plugin添加了接口,所以可以使用app.use的方式;
app.use(SentryVue, {
    router,
    env: process.env,
    config: {
        dsn: "xxxx",
        Blacklist: [],
    }
})

// 在vue2中使用需要在option中加入isVue2: true
new SentryVue({
    ...
    env: process.env,
    isVue2: true,
    ...
})

SentryVue static

SentryVue 中的静态方法和变量

SentryVue.install

Vue plugin install 用于app.use

SentryVue.send && SentryVue.msg

用于主动发送错误信息,

TODO 没发现两者区别需要再研究

SentryVue.send(error,{ extra, tags, level, hint ....})
SentryVue.msg(error,{ extra, tags, level, hint ....})

 

 

SentryVue options

new SentryVue(options);
SentryVue.install(app: Vue, option: Omit<SENTRY_PROPS, "app">);

options.app

options.app : Vue | Vue[];

在Vue3中可传入多个Vue实例,但是在Vue2中只能传入一个Vue实例

options.router

Vue router

options.isDev

如果是本地环境,会跳过sentry的初始化,比如 用yarn dev 这种本地命令启动的环境

options.env(0.1.1之后废弃, 不同版本的打包工具会有不同的环境变量,直接删除掉)

用到的两个属性npm_lifecycle_eventNODE_ENV

npm_lifecycle_event如果是dev会跳过sentry的初始化

NODE_ENV作为副选来判断sentey的收集的环境, 初始化首选options.config.environment

如果两个都没有,会默认为生产环境

options.config

interface config = {
    dsn: string; // sentry dsn;
    environment?: string; // sentry environment  默认为 production;
    Blacklist: Array<string | RegExp>; // 域名黑明名单, 用于过滤不需要收集的域名;
    tracesSampleRate: number; // 取值 0-1 之间的数值 表示采样率 1为100% 0为0%(不会发送) 默认为1;
}

options.isVue2

是否是Vue2

 

Vanilla

TODO ...

 

ReactNative

TODO ...

 

React

TODO ...

soucemap

# install 
npm install @sentry/cli -g

在项目根目录创建 .sentryclirc文件

[defaults]
url=https://sentry.io/
org=eft-sc
project=PROJECT_NAME
[auth]
token=PROJECT_AUTH_TOKEN
# 清除版本号的sourcemap
sentry-cli releases files <版本号> delete --all
# 上传
sentry-cli releases [-o 组织名] [-p 项目名] files <版本号> upload-sourcemaps <打包后的js目录> --url-prefix <线上js访问地址>