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 🙏

© 2026 – Pkg Stats / Ryan Hefner

web-hunter

v0.0.3

Published

A tracking tools(Operation data fetch) on front end web page

Downloads

10

Readme

web-hunter

English | 简体中文

The general scheme of front-end tracking can collect the information of the device, browser version, window size, domain name, PV / UV, browsing time of each page, total browsing time and so on.

Installation

Browser

donwload dist/web-hunter.min.js

A simple and fast way to get started is to include this script on your page:

<script src="web-hunter.min.js"></script>

This will create the global variable Hunter

NPM

npm i npm i web-hunter

or

yarn  add npm i web-hunter

CommonJS

const Hunter = require('web-hunter')

ES2015

import Hunter from 'web-hunter'

Usage

  var hunter = new Hunter()
  console.log('user',hunter.getDirectData());

  /**user : {
            browse: "chrome 89.0.4389.9" ,
            device: "pc",
            domain: "localhost",
            lang: "zh-CN",
            os: "Win10"
            referrer: "",
            screen: {w: 1920, h: 1080},
            title: "Document",
            userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.9 Safari/537.36"

  }**/

When the user gets the user information after login, setuserid () can be used to set the user ID

hunter.setUserId('test')

When the setuserid () method is called, the PV / UV information and the user's residence time will be recorded automatically.

console.log('getModuleVisits', hunter.getModuleVisits());
console.log('getPV', hunter.getPV());

Config

var hunter = new Hunter({
    baseUrl: '',  // baseUrl
    url: '',  //The interface address of the request reporting API
    routeMode: 'history',//The routing mode used in single page application.(history|hash)
    autoUpload: true,//Whether to automatically request the interface, after setuserid, it will automatically request the interface reporting PV / UV in the form of baseurl + URL when the page is switched
    prop: {   //Request parameter mapping. The default parameter name is as follows. You can customize and modify the parameter name.
        uv: 'uv',
        pv:'pv',
        id: 'id',
        mVisits: 'mVisits',
        domain: 'domain',
        title: 'title',
        referrer: 'referrer',
        screen: 'screen',
        lang: 'lang',
        userAgent: 'userAgent',
        os: 'os',
        browse: 'browse',
        device:'device',
    },
    }
})

Methods

getConfig():Gets the current configuration item

getDirectData():Access to directly accessible data

setUserId(id):Set user ID

getUserId():Gets the set user ID

getPV():Get PV

setPV():Setting PV manually

clearPV():Clear the accumulated PV, which is used to clear the record when the record is submitted manually

setUV():Manually set UV amount

getFirstLogin():Get the first login (record userid) time

getOnlineTime():Get online time (requires userid)

getModuleVisits():Get module access (divided by URL)

track: function (url,param,callback):Report data manually. URL: request address, param: request parameter, callback: request callback

Browser support

Modern browser and ie10 +

| IE / Edge | Firefox | Chrome | Safari | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | IE10, IE11, Edge | last 2 versions | last 2 versions | last 2 versions |

License

MIT license.

Copyright (c) 2021-present LuYingHeng