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

@tmjeee/w-lib

v0.1.4

Published

A minimal, modern TypeScript library skeleton ready for publishing to npmjs.com. Includes helloWorld sample.

Readme

w-lib

npm version License: MIT

Development

See here for more info.

A minimal, Angular and TypeScript library.

Installation

npm install @tmjeee/w-lib

Usage

This package is ESM-only.

Uint8ArrayBuffer (Generic)

An Uint8Array buffer that allows writing data that will auto resize, so we don't have to worry about resizing

  // create buffer
  const buffer = new Uint8ArrayBuffer();
 
  // create buffer with initial size of 1024 bytes
  const buffer = new Uint8ArrayBuffer(1024);
 
  // write data and don't worry about resizing
  // if insufficient space, buffer will automatically grow (doubling capacity as needed)
  buffer.write(new Uint8Array([1, 2, 3]));
  buffer.writeByte(4);
  const result = buffer.toUint8Array(); // Uint8Array [1, 2, 3, 4]

  buffer.length; // length of data
  buffer.capacity; // how much this buffer can store without resize

  buffer.clear(); // clear data pointer, will not clear data
  buffer.reset(); // clear data, fresh Uint8Array allocation

Finite state machine (Generic)

import {FsmState, Fsm} from '@tmjeee/w-lib';

  class State1 extends FsmState {
    enter(prevState: FsmState | null, ...params: any) {
      console.log(`[State1] enter`);
    }
    exit(nextState: FsmState | null, ...params: any) {
      console.log(`[State1] exit`);
    }
    update(...params: any) {
      console.log(`[State1] update`);
    }
  }


  class State2 extends FsmState {
    enter(prevState: FsmState | null, ...params: any) {
      console.log(`[State2] enter`);
    }
    exit(nextState: FsmState | null, ...params: any) {
      console.log(`[State2] exit`);
    }
    update(...params: any) {
      console.log(`[State2] update`);
    }
  }

  const fsm = new Fsm();
  fsm.register(
    new State1(`state1`),
    new State2(`state2`),
  );

  fsm.set('state1', {});  // state1.enter(...)
  fsm.update();           // state1.update({})
  fsm.set('state2');      // state1.exit(...) then state2.enter(...)
  fsm.update();           // state2.update({});
  fsm.get();              // return current state -> state2

State Management (Generic)

  const store = createStateStore<State>({
    name: 'jim',
    age: 12,
    address: {
      address1: '1 Kent Street',
      address2: 'Sydney',
      postcode: '2000',
    }
  });


  const address1 = store.get('address.address1');
  store.on('change', (change) => {
    const state = change.state;
    const previousState = change.previousState;
    const value = change.value;
    const previousValue = change.previousValue;

    console.log(`change`, state, previousState, value, previousValue);
  });

  // all the following will trigger 'change' event
  store.update('address', (address) => ({address1: 'new address1', address2: 'new address2', postcode: 'new postcode'}));
  store.update('name', (name) => `name-${new Date()}`);
  store.set('name', 'name1');
  store.patch({age: 2, name: 'test'});
  store.batch((ctx) => {
    ctx.set('age', 1);
    ctx.update('age', (age)=>age + 1);
    ctx.patch({age: 2, name: 'test'});
  });

Event Emitter (Generic)

  const emitter1 = new JsEventEmitter();
  const emitter2 = new JsEventEmitter();
  emitter1.on('test',()=>{
    console.log(`[Emitter1] Receive test event`);
  });
  emitter2.once('test', ()=>{
    console.log(`[Emitter2] Receive test event - once only`);
  });
  emitter1.emit('test', {test: 'test1'});
  emitter1.emit('test', {test: 'test2'});
  emitter2.emit('test', {test: 'test1'});
  emitter2.emit('test', {test: 'test2'});
  emitter1.off('test'); // turn off listening
  emitter1.emit('test', {test: 'test3'});

Disclaimer

Disclaimer: Contains codes from jyoung4242.

License

MIT © 2026 tmjeee