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

@verzth/statisticjs

v2.0.0-alpha13

Published

[![GitHub version](https://badge.fury.io/gh/verzth%2Fstatisticjs.svg)](https://badge.fury.io/gh/verzth%2Fstatisticjs) [![npm version](https://badge.fury.io/js/%40verzth%2Fstatisticjs.svg)](https://badge.fury.io/js/%40verzth%2Fstatisticjs)

Downloads

962

Readme

statisticjs

GitHub version npm version

Javascript Library for Statistic Engine, it use in client side to help make auth simpler. For Android SDK version can be found here.

Dependencies

Installation

NPM

npm i @verzth/statisticjs

or

npm i --save @verzth/statisticjs

How to Use:

  1. Add script in your html, use statistic.min.js for minified version, or you can use statistic.bundle.js for minified version which was included tcx.bundle.js, all our bundle (By verzth) doesn't include jquery, so you need to add your own script (Because jquery frequently used by developers).

    <script src="{file_path}/statistic.js"></script>
  2. Initialize Statistic object with params, it will use default value if you don't provide params.

    var statistic = new Statistic({
     serverUrl : '',
     page : 'host',
     page_type : 'website',
     type : 'hit',
     key : 'YOUR_KEY'
    });
  3. Available function:

    • isModelAvailable(): boolean - Check statistic data model availability.
    • dismiss(): void - Dismiss data model, also mark model as not available.
    • isDataAvailable(): boolean - Check statistic data queue inside model.
    • clearData(): void - Clear all data queue inside model.
    • setPage(string page): Statistic - Set Page name.
    • setPageType(string type): Statistic - Set Page type.
    • setInteraction(boolean interaction): Statistic - Set Interaction type, "true" user action, "false" system action.
    • setUserID(string id): Statistic - Set User ID, for logged in action.
    • send(): void - Send statistic data to server.
    • putCustom(string key, string value): Statistic - Add custom attribute to statistic model.
    • createHit(): Statistic - Create statistic hit level type.
    • createContent(): Statistic - Create statistic content level type.
      • setID(string id): Statistic - Set Content ID.
      • setType(string type): Statistic - Set Content Type.
      • setCategory(string category): Statistic - Set Content Category.
      • setAction(string action): Statistic - Set Action of Content (Ex: Impression, Click, etc).
      • setCallforward(string url): Statistic - Set forward action link to trigger backend realtime action.
    • makeContent(): Statistic
      • addContent(): Statistic - Add content to the content data model.
      • commit(): Statistic - Close content transaction and push to server.
    • createEvent(): Statistic - Create statistic event level type.
      • setID(string id): Statistic - Set Event ID such as invoice number.
      • setType(string type): Statistic - Set Event Type.
      • setCategory(string category): Statistic - Set Event Category.
      • setName(string name): Statistic - Set Name of Event (Ex: Sale, Buy, Play, Open App, etc).
      • setCallforward(string url): Statistic - Set forward action link to trigger backend realtime action.
      • setOk(boolean state|true): Statistic - Set event status state.
      • setStatus(string status): Statistic - Set event status.
      • setStatusCode(string code): Statistic - Set event status code.
      • setStatusMessage(string message): Statistic - Set event status message.
    • makeEvent(): Statistic
      • addEvent(): Statistic - Add event to the event data model.
      • commit(): Statistic - Close event transaction and push to server.

*Note: This library only available for internal corporate / 3rd Party usages, some features may not described.