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

if-wolftrack

v1.0.4

Published

埋点程序

Downloads

6

Readme

WolfTrack

原名wolf-logger 更名为wolf-track

Deps 依赖

if-ua, if-spm

window.WolfConfig

在调用程序前请先配置该设置

window.WolfConfig = {
    spm: { a: "default", b: "main" },
    pv: {
      where_to_sendpv: "//xiaoheizhang.cn/prod.gif",
      where_to_record: '//127.0.0.1/a.gif',
      PV_TO_URLS: [
        ["127.0.0.1", "local"],
        ["localhost", "local"],
        ["dev", "dev"],
        ["test", "test"],
        ["uat", "uat"],
      ],
    },
}

简单配置即可使用

<script>
  var SITE_APP_ID = 'P011'
  var LOGSITE = '埋点数据接收地址'
  var WolfConfig = { spm: { a: SITE_APP_ID, b: "main" }, pv: { p_id: SITE_APP_ID, application: '4', where_to_sendpv: LOGSITE[0]}, is_auto_pv: true, spa: true };
  (function () {
    var wf = document.createElement("script");
    wf.src = "//if-fe-assets.oss-cn-beijing.aliyuncs.com/pkg/if-wolftrack/1.0.2/if-wolftrack.js";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(wf, s);
  })();
</script>

window.WolfTrack

初始化

const wolf = new WolfTrack()

sendPV

发送PV信息

const config = {
    method: 'POST'
}, data = {foo: 'Hi,World'}
wolf.sendPV(config, data)

record

主动上报

const data = {foo: 'Hi,World'}
wolf.record(data)

版本

  • 1.0.4 PV字段支持动态获取(函数)
  • 1.0.3 移除了FingerPrint指纹算法,使用了更为简单高效的uuid的算法,打包后体积45KB