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

virst

v0.17.2

Published

various asynchronous signal based html first client side library

Readme

about virst

virst is:

  • pronounced /fɜrst/ ("technically" pun of first /fɜrst/ and burst /bɜrst/);
  • new repo/library based on @html_first/simple_signal;
  • which itself are inspired by solidJS signal based reactivity
  • which then simple_signal will be discontinued effective immediately;
  • collections of library for creating:
  • reactive(and if necessary, declarative) SPA web app, including functionalities such as:
  • client side routing (using query parameter with our DefineQRouter);
  • signal based asyncrhonous reactivity, which supports:
  • dataOnly;
  • with "dom reflector" (using attributeName="...attributeValues;");
  • templating using:
  • native web component with WebComponent Instance;
  • Lifecycle Instance with:
  • html onConnectedOptions to modify element innerHTML;
  • DefinePageTemplate attributeName template on other page with swap
  • client side JS library that are relying on attributeName to track the element lifecycle, using our Lifecyle class api:
  • you can use it to create your own HATEOAS (like htmx) client side library, to interprete returned htmlString which have certain attributeName;
  • handle non editable static site generated exports/publish such as:
  • bootstrap studio;
  • pinegrow;
  • WYSIWYG web builder;
  • or bassically any kind of SSG software;
  • added globals in window object window["virst"]["QUnique"] and window["virst"]["QFIFO"] so any library that, targets client side bundled and, are written using virst Lifecycle will share the same queue handler;
  • comes with asyncQueue handler in the background;
  • no need to scratch your head too much for async processes;
  • all of our class api are typed with jsdoc:
  • if you cannot find the documentation in this readme, you can allways rely on your IDE intellisense

about this readme

  • this repo/lib only serves for api-documentation purposes;
  • as for example on how to use on different useCase refer to html-first-virst

how to install

npm i virst
// or
bun i virst
// or any js package manager with npm capability

v0.^9.x

  • drop supports for Animation
  • it's better to use more dedicated library like animeJS

v0.^12.x

  • drop supports for Component
  • uses native web component instead using WebComponent class
  • it's a fix for Lifecycle behaviour and simple WebComponent generation class

v0.^15.x

  • fixed Lifecycle scope mechanism
  • added class attributeSelector to dynamically proportional binding conditionally by using signal value;

v0.^16.x

  • semantics and fixes for onViewPort;
  • onViewPort will no longer be exported to virst main module;

exported-api-and-type-list

  • helper class to track connected/disconnected/attributeChanged of an element;
  • instead of manually assigning whether attributeName should be global or not, outOffScoped attributeName will produce warning in the runtime;
  • you can ignore it, as the most local Lifecycle will take priority, and when there are no other scope, the most global will take place, the warning is only to notify that you can still optimize your code further by renaming the conflicting attributeName by abiding more to the semantics;

*) go to exported list

trigger based callback integrated to the internal library queue handler; can be created using class instantiation;

*) go to exported list

helper methods for creating Promise to block execution code that return { resume } to allow subsequent calls to proceed;

const { resume } = await Q.fifo(); // or Q.unique(id)
// code
 resume(); // before return

*) go to exported list

function wrapper that turns callback into queued calls;

*) go to exported list

generate side effect for signal based reactivity such as for:

const letExample = new Let('')
new $(async(first)=>{
 const value = test.value;
 if(first){
     return;
     // return early if you want to opt out from handling the effect immediately,
     // also by doing this you can make the `$` slightly more performance 1) when dealing with `async await` on hydration,
     // such as data fetching;
 }
     // handle value
})
// 1) and when all of the effects is registered, you can call `letExample.call$` to call for effect in parallel;
// bassically the same with `Let` but use `new Derived`

*) go to exported list

  • this class is extended from Let Let
  • signal based reactivity, wich value are derived from reacting to Let<T>.value effects that are called in the asyncCallback this class instantiation;
// @ts-check
const letSingle = new Let(1);
const doubleExample = new Derived(async()=>{
	const value = letSingle.value; // autoscubscribed to `letSingle` value changes;
return value * 2; // returned value are to be derivedValue
});
  • dataOnly:
const dataOnlyExample = Derived.dataOnly(asyncCallback);
  • this will automatically opt you out from domReflector;
  • make sure to check argument documentation in your IDE typeHint;

*) go to exported list

signal based reactivity; assigning newValue to Let insance:

  • dataOnly:
const dataOnlyExample = Let.dataOnly(args0);
  • with domReflector;
const letSingle = new Let(1, ...args);
letSingle.value++; // 2;
letSingle.value = 3 // 3;
  • the domReflector will automatically synchronise the value with the element on the dom;
<div attributeName="...selectorsSeparatedBySemicolon"></div>
  • selector can be attributeName or propertyName:
  • special selector value: will automatically bind the value with oninput event;
  • special selector class: will dynamically add/remove classes, must be formated like this {class: "strings of HTMLClassNames separated by space"}

*) go to exported list

  • helper class to create list that satisfy Array<Record<string, string>>
const listExample = new List([
     {key1: "test", ...keys},
     {key1: "test3", ...keys},
])
  • usefull for loops;
  • instance method: 'push'|'unshift'|'slice'|'splice'|'swap'|'modify'|'shift', serves as helper to mutate, and notify for signal for effects:
  • slice uses splice in the background, you don't need to manually reindex when using it;

*) go to exported list

  • auto attributeName assign for signal based reactifity stored in static Method of class _;
  • if you use our Component class, use this class static method, instead of their respective class, for generating attributeName to watch, which then you can use it's attr returned value to mark the element
// on Component scope
onConnected(async()=>{
	const data = _.l('test');
	html`<div ${data.attr}="innerText"></div>`
})

*) go to exported list

App starter helper for module environtment:

  • the sole purpose is just to auto import the necessary global file in your main js file;
  • if it's elementScoped instances/statics methods, it will be better to just leave it for the parentModule to import it accordingly;
/**
 * @typedef {Object} constructorOptions
 * - for efficiency, only fill this options when you intent to use the library as sole `View` part of your stack;
 * - the inputed root component must manually fills attr option argument, to target root element on the real dom;
 * @property {(import("../lifecycle/Lifecycle.mjs").Lifecycle)[]} [options.lifecycles]
 * @property {(import("./For.mjs").For)[]} [options.forS]
 * @property {import('./DefineShortCuts.mjs').DefineShortCuts} [options.defineShortcuts]
 * @property {import('./DefineQRouter.mjs').DefineQRouter} [options.defineQRouter]
 * @property {import('./DefinePageTemplate.mjs').DefinePageTemplate} [options.definePageTemplate]
 * @property {number} [options.pingDebounce]
 * in ms;
 * @property {import('./DefineStorage.mjs').DefineStorage} [options.defineStorage]
 * @property {typeof helper["webComponentGlobalStyles"]} [options.webComponentGlobalStyles]
 * @property {import('./FSsrc.mjs')} [options.defineFSSourceMapper]
 * use custom encoding(eg. base64) to replace original file's source path;
 * usefull when using `web-app` as `View` stack for `desktop-app`, `mobile-app` or other bundle target, removing the need to setup http server to display the file on the `browser`;
 */

*) go to exported list

CRUD wrapper class;

  • signal will be updated from returned value of read;
  • read will be called after calling thisInstance.create/update/delete_ that have true updateRead; /** @template V

*) go to exported list

  • instantiate this class to opt in page templating, by saving html template string on a html document page;
  • html implementation:
// main page
<div ${templateName}="${path};${templateName};${mode}"></div>
// mode = 'inner' | 'outer'
  • templateName of head & body are reserved for document.body and document.body of the template document, you can use it without adding targetAttribute="head" or targetAttribute="body" on the respective element;
// template document
<div ${targetAttribute}="${selector}"></div>
  • how it works:
  • the class itself register a Lifecycle for templateName, which then upon connected, it will fetch the path then selects targetAttribute="selector" as template that then replace main page innerHTML with selected element innerHTML from template;
  • fetched page will be then be cached, along with any [targetAttribute] on that page

*) go to exported list

allow the usage of search query based router through class instantiation;

  • register by App.constructorOptions.defineQRouter

*) go to exported list

create shortcuts through class instantiation;

  • register by App.constructorOptions.defineShortcuts

*) go to exported list

create named storage (localStorage or sessionStorage) through class instantiation;

  • register by putting import this instance on your js main file

*) go to exported list

use this instead of normal eventListener declaration for:

  • creating autoqueued listener;
  • autoScope _ static methods, inside Component scope;
// @ts-check
someObject.addEventListener('click', Event_.listener( (event) => {
// code
}))

*) go to exported list

  • assign element to loop through 'List' as data to render child element using class instantiation;
  • loped childElement:
  • must have HTMLElement as first children;
  • only first children will be used to loop through List, all other children will be deleted from the dom before onConnected event of parentElement;
  • use ListInstance method helpers to mutate the data;

*) go to exported list

  • use custom encoding(eg. base64) to replace original file's source path;
  • usefull when using web-app as View stack for desktop-app, mobile-app or other bundle target, removing the need to setup http server to display the file on the browser;
  • register by App.constructorOptions.defineFSSourceMapper

*) go to exported list

shared statics

*) go to exported list

  • helper class to create ShortCut through class instantiation;
  • call thisInstance.ping to manually trigger action

*) go to exported list

error as value helper; method(s):

  • async;
  • sync;

*) go to exported list

centralized virst object for lib making

*) go to exported list

  • native web component creation helper;
  • you can add global css rules by inputing urls to AppInstantiation arg0.globalStyles;

*) go to exported list

helper class for registering and postMessage to webWorker

const worker = new WorkerMainThread(options);
worker.postMessage(message);

*) go to exported list

helper class to define web worker thread;

new WorkerThread({
	onMessage: ({ event, postMessage }) => {
		const message = undefined;
		// code to handle the message
		postMessage(message);
	},
});

*) go to exported list