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

yunxiaowei-tabc-web

v0.0.1

Published

---------------

Downloads

3

Readme


TAB云实验平台web sdk

Installation

  1. install using tnpm
$ tnpm install @tencent/yunxiaowei-tabc-web-saas
  1. import script
<!-- 使用灯塔sdk上报实验事件 -->
<script src="https://beaconcdn.qq.com/sdk/3.1.42/beacon_web.min.js"></script> 
<!-- 实验SDK -->
<script src="https://res.abtest.qq.com/tabc_saas/tabc_sdk.min.js"></script>

Usage

1. 集成SDK:

tabc.init(  // 只能初始化一次
{ 
  appkey: "申请的appkey", 
  guid: "用户的唯一id", // 传人一个用户身份,用来做分流标识
  // isTest: true, // 使用测试环境
  // timeout: 1, // http超时设置,单位秒。 默认2s
  // profiles: {'sexy':'male'}, // 用户属性,可以用来做标签实验
  // antiFlicker: true,   // 打开防闪烁开关,原理是先隐藏原有页面,待sdk init完成后将页面显示出来
  // antiFlickerTimeout: 500, //防闪烁超时时间,超过此时间无论sdk是否完成init都会将隐藏的页面放出来,防止异常情况下页面一直白。默认500毫秒。
  onInit: function(data) { // 初始化完成,加载完本地缓存策略
    console.log('init fniish');
  }, 
  onNetData: function (data) { // 加载完成网络策略
    console.log('net fniish');
  }
});

2. 相关API:

web实验支持可视化编辑和下发配置,一般不需要代码实验。 如果需要一定的参数逻辑,可以使用下面的API

getExpByName(**)

{
  grayId: 123, params:{...}
}

通过实验名称获取实验

reportExpExpose(exp)

上报一次实验曝光

reportExpEvent('someclick', exp)

上报一次实验事件

getAllParams()

[{
    grayId: ***, param: { key: val, key2: val2 ...}
}, ...]

返回所有命中的实验id及其对应的参数

getParam(paramKey)

{
    grayId: ***, value: ***
}

返回所命中实验里面对应paramKey的参数值及其对应的实验id

forceUpdate()

此api的作用是强制更新实验样式,在页面有二次刷新导致实验效果被覆盖的情况下使用(如ssr的页面直出后应用了实验效果,但异步加载数据又覆盖了实验效果)。

License

ISC