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

@developer-once/eagle-eye

v1.0.2

Published

Monitor SDK

Downloads

6

Readme

Eagle-EYE-SDK

Eagle-eye 是一款全埋点的监控 SDK,只需简单的引入和传入配置便可以在项目中一键接入。

使用

只需要引入并初始化, SDK 就会开始进行默认的全埋点监控。对用户的点击事件进行上报,以及默认使用。

NPM 接入

// 下载 SDK
npm i @developer-ones/eagle-eye-sdk -S

// app.ts
import initMonitor from 'eagle-eye-sdk';
const monitor = initMonitor({
  globalClick: true,
  // - 以下项为必填 -
  app_key: "vite_test",
});

// -- 销毁 --
// monitor.destory();

// -- 上报 --
// monitor.report("type", data);

// -- 自定义错误上报 --
// monitor.error(error);

function App() {}
export default App

Script 接入

<script crossorigin="anonymous" src="./eagle-eye.js"></script>
<script>
  var config = {
    url: "/api/report",
    globalClick: true,
    // 以下两项为必填
    app_key: "vite_test",
    startTime: new Date().getTime()
  };
  
  window.monitor = window.eagleEye.initMonitor(config);
</script>

配置项

| 参数名 | 类型 | 必填 | 描述 | 默认值 | 备注 | | ------ | ---- | ---- | ---- | ------ | ---- | | app_key | string | true | 每个项目一个,请于后台创建项目生成 | - | | | url | string | true | 设定日志上传地址,一般不用修改,请务必清楚修改该字段的意义 | - | | | startTime | number | | 初始化的时间 | new Date().getTime() | | | slowAjaxCost | number | | 慢请求阈值,超过将会被记录 | 700 | | | slowResourceCost | number | | 慢资源阈值,超过将会被记录 | 400 | | | record | boolean | | 是否记录报错录制回放,由于上报回放 rrweb,请求庞大请在后台通过项目设置开启 | false | | | enableSPA | boolean | | 是否监听页面的 hashchange 事件并重新上报 PV,适用于单页面应用场景 | true | | | autoSendPv | boolean | | 是否初始化后自动发送 PV,默认会自动发送 | true | | | recordReSoure | boolean | | 是否上报资源数据,默认会 | true | | | disableHook | boolean | | 是否禁用 AJAX 请求监听,默认会监听并用于 API 调用成功率上报 | false | | | globalClick | boolean | | 是否监听全局点击事件 | false | | | disableAjax | boolean | | 是否禁止监听 Ajax | false | | | disableFetch | boolean | | 是否禁止监听 fetch | false | | | openHeartbeat | boolean | | 是否开启心跳检测 | false | | | serverOpenRecord | boolean | | 服务端开启报错回放录制,注意请不要配置该字段,应在后台设置 | false | |

开发

npm run start