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

ans-node-sdk

v4.0.6

Published

This is the offical Node SDK for Analysys.

Downloads

16

Readme

易观方舟 ans-node-sdk NPM version License GitHub release

安装

$ npm install ans-node-sdk --save

Node SDK 基础说明

  • 快速集成

    // 非es6 
    var AnalysysAgent = require("ans-node-sdk");
    var LogCollector = require('ans-node-sdk/sdk/AnalysysAgent_NodeJS_SDK_LogCollecter.cjs');
    
    // es6 
    import AnalysysAgent from "ans-node-sdk"
    import LogCollector  from 'ans-node-sdk/sdk/AnalysysAgent_NodeJS_SDK_LogCollecter.cjs';
    
    // SDK 初始化
    var AgentConfig ={
        appId : appId,
        uploadURL:uploadURL,
        debugMode:debug, 
        postNumber:postNumber,
        postTime:postTime,
        logCollector:new LogCollector({   
            gerFold:gerFold,
            gerRule:gerRule
        })
    }
    
    var analysys = new AnalysysAgent(AgentConfig);
  • appId: 网站获取的 Key。

  • uploadURL: 数据接收地址。

  • debug: debug模式,有 0、1、2 三种枚举值。

    • 0 表示关闭 Debug 模式 (默认状态)
    • 1 表示打开 Debug 模式,但该模式下发送的数据仅用于调试,不计入平台数据统计
    • 2 表示打开 Debug 模式,该模式下发送的数据可计入平台数据统计 注意:发布版本时debug模式设置为0
  • postNumber: 批量保存数量,默认值:0条,实时上传。

  • postTime: 批量保存等待时间(秒),默认值:0。

  • logCollector: 落日志到本地。默认不开启,开启需要配置 gerFold和gerRule。

  • gerFold: 落日志存放的路径。

  • gerRule: 落日志存放的格式,有 "H"小时 和 "D"天 两种枚举值,默认"H",按小时切割文件。

注:假如启用了落地文件收集器,配置中的uploadURL将不再生效。

通过以上步骤您即可验证SDK是否已经集成成功,更多Api使用方法参考:易观方舟 Node SDK 文档

注意 SDK 可能不完全向前兼容,请查看版本更新说明 Release及版本升级记录。如果有说明不兼容的话,需要升级易观方舟对应的版本。 请根据需要前往 Release 里下载对应的文件

版本升级记录

请参见 Release及版本升级记录

讨论

禁止一切基于易观方舟 Node 开源 SDK 的所有商业活动!


NPM downloads