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 🙏

© 2025 – Pkg Stats / Ryan Hefner

zumjs-v2

v0.5.0

Published

Javascript library for interacting with zum server

Downloads

3

Readme

ZUM JS V2

Zum Js v2 is a version without njwt dependency. Outgoing data relies on https security as is the normal internet standard, rather than being encoded into tokens. Before using these modules install and require the library

npm install zumjs-v2
const zum = require('zumjs-v2')

configure

This is a required module for the client to interact with the zum server. It configures the client with the necessary details like appName and server endpoints. No other module will work unless the client is configured.

zum.configure({
// all values default to null unless specified
})

These values can be passed inside the configuration object to undertake various operations using the library

  • appName : Every app registered in zum has a unique app name. It serves as an id to identify the app.
  • mk : Master key endpoint
  • register : Registration endpoint
  • users : Users endpoint
  • login : Login endpoint
  • logout : Logout endpoint
  • verify : Token verification endpoint
  • stats : Endpoint for server and user stats
zum.configure({
    appName : 'myapp',
    register: 'http://www.myapp.com/register',
    login: 'http://www.myapp.com/login',
    verify: 'http://www.myapp.com/verify',
    users: 'http://www.myapp.com/users',
    mk: 'http://www.myapp.com/mk'
});

register

Create a new user. User will need to verify the email address before signing in, unless verified flag is set to true

zum.register(claims, callback)
  • claims : User data
zum.register({
    username : 'zaygo',
    password : 'Mypass@123',
    name : 'Arjun Nair',
    email : '[email protected]',
    scope : 'admin',
    country : 'Austria',
    verified : false
}, (err, res) => {
    if (err) throw err;
    console.log(res.status);  // successful if status is 200
});

login

Acquire access token for a user

zum.login(username, password, callback)
  • username : Unique username
  • password : User password
zum.login('zaygo', 'Mypass@123', (err,res) => {
    if (err) throw err;
    console.log(res.status);  // successful if status is 200
    console.log(res.headers['x-auth-token']);  // access token can be found inside the response header
});

update

Update user account

zum.update(username, update_object, callback)
  • username : Unique username
  • update_object : Object containing parameters to update
zum.update('zaygo', {
    name : 'Zaygo',
    country : 'Germany'
}, (err,res) => {
    if (err) throw err;
    console.log(res.status);  // successful if status is 200
});

terminate

Delete user account. User will receive an email.

zum.terminate(username, delete_object, callback)
  • username : Unique username
  • delete_object : Contains the reason and initiator for the termination. These details will be passed to the user via email.

fetchUser

Fetch user details using the username or email

zum.fetchUser(user, callback)
  • user : username or registered email of the user

serverStats

Get raw server stats of the zum server. Currently provides cpu, memory and disk stats.

zum.serverStats(callback)

Callback will contain :

  • cpu : Real time cpu utilization
  • mem : Real time memory utilization
  • disk : Real time disk utilization

userStats

Get general user stats

zum.userStats(callback)

Callback will contain :

  • registered : Number of registered users on the server
  • logged : Number of users currently logged in
  • disabled : Number of users currently disabled

disable & enable

Disable a user for a certain number of days or manually re-enable a disabled user. The user will receive an email.

zum.disable(username, days, reason, callback)
zum.enable(username, callback)
  • username : Unique username
  • days : Number of days before the ban ends
  • reason : Reason for the ban
zum.disable('arjun', 7, 'You violated rule 4', (err,res) => {
    if (err) throw err;
    console.log(res.status);
});
zum.enable('arjun', (err,res) => {
    if (err) throw err;
    console.log(res.status);
});

verify

Verify access token

zum.verify(username, token, callback)
  • username : Unique username
  • token : Access token received from zum server

otpLogin

Login using otp

zum.otpLogin(receiver, callback)
  • receiver : Registered mail id or mobile number

verifyOtp

Check the validity of otp

zum.verifyOtp(receiver, otp, callback)
  • receiver : User's registered mail id or mobile number
  • otp : Digital code received on mail or mobile and supplied by the user

logout

Logs out the user and invalidates the access token

zum.logout(username, callback)
  • username : Unique username