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

hubble-tool

v2.0.1

Published

hubble-tool base on hubbleSDK

Downloads

4

Readme

用法

第一步

//入口index.js

    import hubble from 'hubble-tool';
    
    Vue.use(hubble, {
        online: true/false, //默认false
        appKey: {
            online: hubble 线上环境appkey,
            test: hubble 测试环境appkey
        },
        hubbleOpt: {},//可选参数,hubble初始化的配置
        defaultEvent: {
            id: 'hubble创建的事件ID',
            page: () => {} //不传默认获取document.title
        },// 也可写为 defaultEvent: 'hubble创建的事件ID',
        username: 'XXX', //可选参数,如果传了,则第二步不用主动调用login
    });

第二步

// 获取完用户信息后

    DATracker && DATracker.login(username || '未知账号');`

第三步:业务使用

  • 分为两种方式:函数式、指令式 (参数支持字符串、对象)
  • 参数:name为必传参数,page、extra为选传参数,extra不为空时必须为合法字符串
指令式
<span v-btnTracker='测试埋点'>测试埋点1</span>

<span v-btnTracker='{name:"测试埋点对象数据", extra: "{"aa":1}"}'>测试埋点2</span>

<span v-btnTracker:anthorEventId='{name:"其他类型的事件"}'>测试埋点3</span>
函数式
组件中:
this.$btnTracker({name:'AA'})
this.$btnTracker({name:'AA', extra: '{"aa":1}'})
this.$btnTracker({name:'AA', page: '编辑页面', extra: '{"aa":1}'})

非组件中:
window.btnTracker({name:'AA'}, 'anthorEventId')
window.btnTracker({name:'AA', extra: '{"aa":1}'}}, 'anthorEventId')
window.btnTracker({name:'AA', page: '编辑页面', extra: '{"aa":1}'}}, 'anthorEventId')

文档

hubble 文档


更新说明

v0.0.1 功能实现

  • 引入hubble sdk
  • 绑定埋点方法到window对象(btnTracker)、vue实例($btnTracker)
  • 支持vue指令埋点(v-btnTracker)