Socket
Book a DemoInstallSign in
Socket

@nebulars/bury

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@nebulars/bury

Bury Package

latest
npmnpm
Version
0.0.17
Version published
Maintainers
3
Created
Source

千匠星云 统计埋点 -- @nebular.js/bury

安装 - install

yarn add @nebular.js/bury
# or
npm install @nebular.js/bury

导入 - import

import { bury, increase } from "@nebular.js/bury";

使用 - use

bury({
  // 环境参数,布尔
  agent: {
    // 平台
    platform: true,
    // 网络
    net: true,
    // 系统 OS
    os: true,
    // 内核
    core: true,
    // 浏览器
    browser: true,
    // 外壳(如:QQ、360等)
    shell: true,
    // 屏幕尺寸
    screen: true,
    // 原始 UA 信息
    ua: true,
    // 拓展参数
    extend: {
      // 示例
      uuid: `uuid`
    }
  },
  process: {
    // 心跳时长(毫秒)
    heart: 10000,
    // 存储命名空间,默认:bury
    namespace: `burning`
  },
  // 事件行为
  event: {
    // 属性标记名
    attr: `action`
  },
  http: {
    // 默认地址,可以不填
    uri: `http://commerce.xytest.qjclouds.com/`,
    // 参数预设,可用于修改请求对象的初始化行为
    preset: {
      headers: {
        hello: `world`
      }
    },
    // 参数拓展,将合并于每次请求
    extend: {
      custom: `value`
    }
  }
});
<!-- 配置 action 信息,用于信息统计 -->
<div action="information">press me to save info into storage</div>
// 项目数据可由 increase 函数提交
increase({ name: `joker` });
// 隐藏用法:increase 能接收一个 function 作为参数,并将其运行结果作为 提交参数
increase(params => {
  // params 为环境自带参数
  return {
    name: `joker`
  }
});

在 HTML5 中使用 - use in H5

<!-- 引入依赖包 -->
<script src="https://nebular.oss-cn-shanghai.aliyuncs.com/bury/nebular.bury.js"></script>

<script>
  // 初始化
  window.bury({
    /* 参数配置 */
  });

  // 项目数据
  window.increase({
    name: `joker`
  });
</script>

数据格式 -- Data Format

{
  /* start、heart */
  "type": "heart",

  /* event for commit */
  "event": [
    {
      /* Timestamp */
      "time": "stamp",
      /* encode by JSON.stringify */
      "info": "information"
    }
  ]
}

FAQs

Package last updated on 10 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts