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

vite-experiments

v1.0.1

Published

To install the necessary npm packages, run the following command:

Readme

Installation Steps

To install the necessary npm packages, run the following command:

npm install

Usage

In order to create a bundle for experiments, you can run this command

npm run build
  • Repo owner or admin
  • Other community or team contact

ztLibrary

ztLibrary is a lightweight JavaScript library designed to help developers observe DOM changes, wait for elements to appear, handle conditional triggers, and manage cookies and storage. It is compatible with modern browsers and uses ES Modules.

Features

MutationObserver utilities

  • Observe DOM changes efficiently.
  • Track added/removed elements, attribute changes, and text content updates.

Element appearance utilities

  • onAppearAll(selectors, callback, options): Wait until all selectors are present in the DOM.
  • onAppearAny(selectors, callback, options): Wait until any selector is present in the DOM.

Conditional triggers

  • triggerOn(config, callback): Execute callbacks based on DOM conditions, URL checks, timeouts, intervals, or logical AND/OR conditions.

Storage utilities

  • localStorage: get, set, del
  • sessionStorage: get, set, del

Cookie utilities

  • utils.cookie.set(name, value, days): Set a cookie with optional expiration.
  • utils.cookie.get(name): Get a cookie value.
  • utils.cookie.del(name): Delete a cookie.

Object utilities

  • patch(target, source): Merge properties from a source object into a target object.

Installation

import { ztLibrary } from './ztLibrary.js';

// Optionally, attach globally
window.ztLibrary = ztLibrary;

Usage Examples

Observing DOM Changes

const observer = ztLibrary.createObserver((node, mutationType) => {
  console.log('Mutation detected:', mutationType, node);
}, { childList: true, subtree: true });

Wait for Elements

ztLibrary.onAppearAll(['#header', '.menu'], elements => {
  console.log('All elements appeared:', elements);
});

ztLibrary.onAppearAny(['.modal', '.popup'], element => {
  console.log('One of the elements appeared:', element);
});

Trigger on Conditions

ztLibrary.triggerOn({
  condition: 'domElement',
  options: { selector: '#main-content', timeout: 5000 }
}, () => {
  console.log('Main content appeared!');
});

ztLibrary.triggerOn({
  condition: 'url',
  type: 'pass',
  options: { includes: '/dashboard' }
}, () => {
  console.log('User is on the dashboard page');
});

Cookies

ztLibrary.utils.cookie.set('userToken', 'abc123', 7);
const token = ztLibrary.utils.cookie.get('userToken');
ztLibrary.utils.cookie.del('userToken');

Local Storage

ztLibrary.utils.localStorage.set('theme', 'dark');
const theme = ztLibrary.utils.localStorage.get('theme');
ztLibrary.utils.localStorage.del('theme');

Patching Objects

const obj = { a: 1 };
ztLibrary.utils.patch(obj, { b: 2, c: 3 });
console.log(obj); // { a: 1, b: 2, c: 3 }

Logging

ztLibrary.setDebuggedMode(bool) Controlled via the localStorage key zt_debugger.

When enabled, logs info, warnings, and errors to the console for debugging purposes.

Analytics

ztLibrary.setAnalyticsDisabled(bool) You can disable analytics via the localStorage key zt_analytics.

Pipeline rules

There are some requirements that are needed to meet, the rules are:

  • Branch Naming Conventions: Branches should be named according to one of the following patterns:

    • Branches should be named as one variation of:
      • root/.
      • development/exp-#+.#
      • release/exp-#+.#
      • hotfix/exp-#+.#
      • bugfix/exp-#+.#
  • Linting Conventions: You can run the following commands to perform linting checks manually before committing changes:

    • To check JavaScript linting:
    npm run lint:js
    • To check SCSS linting:
    npm run lint:scss
  • Running unit test You can run the following command

npm run test