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

oola-web-fbi

v1.4.0

Published

'网站数据采集统计'

Downloads

1

Readme

简介

基于vue+axios开发; 适用vue框架 适用噢啦项目;

安装

npm install oola-web-fbi@latest --registry=http://registry-npm.gzleihou.cn
  • 在我们噢啦项目服务器上安装,使用cnpm
 cnpm install oola-web-fbi@latest --registry=http://registry-npm.gzleihou.cn 

使用

作为VUE插件,全局添加

  import Vue from 'vue'
  import { WebFBI } from 'oola-web-fbi'
  Vue.use(WebFBI, {
    api: String, // 收集数据的接口地址
    a2: String, // 用于md5加密的字段值
    securityKey: String, // 用于md5加密的字段值
    params: Object // 需要收集的数据字段,相同字段会覆盖默认定义收集的数据字段
  })

VUE组件指令

<component v-fbi="{text: '行为描述'}"><component> // 默认 click行为
// 或
<component v-fbi.${actionEvent}="{text: '行为描述'}"><component>
// actionEvent 目前只支持 click行为
// 所传参数相同字段会覆盖默认定义收集的数据字段,且优先级最高

VUE全局方法

mounted: {
  this.$fbi.sendServer({action: 'click', text: '行为描述'})
  // 所传参数相同字段会覆盖默认定义收集的数据字段,且优先级最高
}

独立方法(不依赖VUE)

  import { GwebFBI } from 'oola-web-fbi'
  const fbi = GwebFBI({
      api: String, // 收集数据的接口地址
      a2: String, // 用于md5加密的字段值
      securityKey: String, // 用于md5加密的字段值
      params: Object // 需要收集的数据字段,相同字段会覆盖默认定义收集的数据字段
    })
  fbi.sendServer({action: 'click', text: '行为描述'})
  • 如果作为VUE插件和独立方法一起使用,两种方法返回的都是同一个对象,配置项会被后定义覆盖,建议把配置项提取出来,避免混乱
  // fbi.config.js
  export const fbiConfig = {
    api: String, // 收集数据的接口地址
    a2: String, // 用于md5加密的字段值
    securityKey: String, // 用于md5加密的字段值
    params: Object // 需要收集的数据字段,相同字段会覆盖默认定义收集的数据字段
  }

目前默认定义收集的数据字段,字段值已自动获取并设置

  {
    channel: getChannel(), // 渠道号,与前端channel业务逻辑密切相关,存储在sessionStorage上的channelCode字段或firstChannelCode字段
    spread: getSpread(), // URL上的参数spread的值
    host: location.host,
    url: location.url,
    href: location.href,
    referer: location.referer, // URL来源,
    system: BrowserSystem.system, // 系统类型,如:ios,android
    vsystem: BrowserSystem.Version, // 系统版本号
    platform: BrowserSystem.platform, // 访问场景,如:oola_app,wx,uc,weibo
    timestamp: Date.now(), // 时间戳
    imei: getVisitor(),
    userId: getUserId() // 用户id,与前端登录系统密切相关,存储在sessionStorage上的userId字段
  }

以上字段可以被覆盖