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

@zaobao/analytics

v1.0.6

Published

zaobao data collection and analytics

Downloads

2

Readme

Usage

<!-- Start Zaobao CN Analytics -->
<script>
    (function (r,c,u,p,t,a,m) {
        r.ctag=r.ctag||function(){(r.ctag.q=r.ctag.q||[]).push(arguments)};r.ctag.ad=t;
        a=c.getElementsByTagName('head')[0];m=c.createElement('script');m.async=true;
        m.src=u+'?'+p;a.appendChild(m);
    })(window,document,"../dist/ctag.js","id=you id&secret_key= you secret&api_host=you api_host")
</script>
<!-- End Zaobao CN Analytics -->
<script>
    //如果scr脚本未携带key,则需要手动创建实例
    //手动创建带参
    ctag("create","you key","you secret",{
        stay_duration: false,
        screen_view: true,
        exception_report: false,
        disable: false,
    });

    // //配置命令
    ctag("config",{
        stay_duration:false,
        screen_view:false
    })
    ctag("config",{
        stay_duration:false,
        screen_view:false,
        exception_report:true,
        disable:true
    })
    // //获取指纹
    ctag('get',"clientId",console.log);
    // //获取网页基础信息
    ctag('get',"measurement",console.log);
    // //获取配置
    ctag('get',"config",console.log)//
    // //获取实例,最后个参数不传,则使用默认实例(第一个)
    ctag('get',"instance",console.log,"you key")//
    // //获取实例,最后个参数不传,则使用默认实例(第一个)
    ctag('get',"instance",console.log)//
    // //获取插件实例
    ctag('get',"plugin",console.log,"measurement")//
    // //移除实例
    ctag('remove',"instance.you key",console.log)
    // //发送screen_view埋点
    ctag('send',"screen_view",{
        page:"home",
        screenId:'124'
    },"you key")

    //设置全局参数
    ctag("set","global",{
        // api_host:"http://172.16.20.79:8080/cg.gif",
        // api_host:"http://172.16.20.75:5000",
        user_id:"userid",
        api_version:"1.3.0",
    });
    //获取全局参数
    ctag('get',"ssid",(e)=>{
        console.log("11",e.toString())
    })//

    ctag('get',"shunt",(e)=>{
        console.log("11",e)
    },"condition_x")//
    ctag('get',"globalConfig",console.log)//
    ctag('get',"sessionId",console.log)//
    //设置页面信息
    ctag("set","auto",{
        nihao:"5555"
    });
    ctag('get',"measurement",console.log)
    ctag("get","automaticallyData",console.log);
    ctag('send',"screen_view",{
        page_name:"home",
        screen_id:'124',
        scene_id:"第三方身份"
    })
    //初始化完成回调
    ctag((ctx)=>{
        console.log("ready")
        // n.a()
        console.log(ctx)

    })
    ctag("plugin","duration:stay",(value)=>{
        console.log(value)
        ctag('send','duration',{
            scene_id:"news_detail",
            item_id:'',
            recommend_id:""
        })
    })
   
</script>

plugin

曝光埋点

<script>
    ctag('plugin',"exposure:observe",document.getElementById("d1"),(intersection,stop)=>{
        if(intersection){
            ctag("send","event",{
                event_name:"",// 事件名称
                event_category:"曝光",//事件类别
                event_label:"中国发展高科技",//事件标签
                event_action:"exposure",//事件动作
                event_value:0,
                experiment_id:2,
                variant_id:4
            })
            stop()
        }
    });
    
</script>

停留时长

<script>
    ctag("plugin","duration:stay",(value)=>{
        ctag('send','duration',{
            scene_id:"news_detail",
            item_id:'121',
            stay:value
        })
    })
</script>

插件注册

<script>
    class PluginInspector {
        static NAME = "inspector";
        version = "1.0.0";
        constructor(options) {
            console.log(options)
        }
        run(c){
            console.log(c)
            console.log('run')
        }
    }
    ctag("install",PluginInspector,{a:1});
    ctag("plugin","inspector:run",true);
</script>