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

@benjos/cookware

v1.0.4

Published

Collection of TypeScript managers, tools and utilities for personal projects

Readme

@benjos/cookware

Collection of TypeScript tools and utilities for my personal projects.

Installation

npm install @benjos/cookware

Requirements:

  • TypeScript ≥ 5.0.0
  • @benjos/spices ^ 1.0.1

Managers (Singletons)

DomKeyboardManager

Handles global keyboard events and exposes actions for key management.

import { DomKeyboardManager } from '@benjos/cookware';

DomKeyboardManager.init();
DomKeyboardManager.onKeyDown.add((e) => console.log('Key down:', e.key));
DomKeyboardManager.onKeyUp.add((e) => console.log('Key up:', e.key));

Extra

  • DomKeyboardManager.isKeyDown(name: string): boolean — Check if a key (by name or code) is pressed.
  • DomKeyboardManager.isAnyKeyDown(names: string[]): boolean — Check if at least one key in the list is pressed.
  • DomKeyboardManager.areAllKeysDown(names: string[]): boolean — Check if all keys in the list are pressed.

DomPointerManager

Unified pointer event management (mouse, touch, pen), exposes pointer position and actions for interactions using Pointer Events.

import { DomPointerManager } from '@benjos/cookware';

DomPointerManager.init();
DomPointerManager.onPointerMove.add(() => {
  // Use DomPointerManager.x, y, normalizedX, normalizedY, etc.
});
DomPointerManager.onPointerDown.add(() => {
  // Pointer down event
});
DomPointerManager.onPointerUp.add(() => {
  // Pointer up event
});

Extra

  • DomPointerManager.x, y — Pointer position in pixels.
  • DomPointerManager.normalizedX, normalizedY — Normalized position (0-1).
  • DomPointerManager.centralX, centralY — Centered position (-1 to 1).
  • Uses Pointer Events (PointerEvent) for unified input handling.

DomResizeManager

Detects window resize events and exposes actions and useful getters.

import { DomResizeManager } from '@benjos/cookware';

DomResizeManager.init();
DomResizeManager.onResize.add(() => {
  console.log('New size:', DomResizeManager.width, DomResizeManager.height);
});

PoolManager

Centralized management of reusable object pools (object pool pattern).

import { PoolManager } from '@benjos/cookware';

PoolManager.init();
PoolManager.add(MyClass, 5); // Pre-fills the pool with 5 instances
const obj = PoolManager.get(MyClass); // Gets an instance (calls obj.init())
PoolManager.release(obj); // Returns the object to the pool (calls obj.reset())

Your class must implement the init() and reset() methods.

TickerManager

Animation loop manager based on requestAnimationFrame, allows adding callbacks executed every frame.

import { TickerManager } from '@benjos/cookware';

TickerManager.init();
TickerManager.add((dt) => {
  // dt = delta time in seconds
});

Advanced options

  • TickerManager.add(callback, { alwaysActive: true }): the callback is called even if the loop is paused.
  • Methods: start(), stop(), pause(), play() to control the loop.
  • Getters: startTime, currentTime, elapsedTime, deltaTime.

Tools (Classes to instantiate)

Action

Event system for handling callbacks.

import { Action } from '@benjos/cookware';

const onUserLogin = new Action<[string, number]>();
onUserLogin.add((username, id) => console.log(`${username} logged in with ID ${id}`));
onUserLogin.execute('John', 42);

Point

3D point class with manipulation methods.

import { Point } from '@benjos/cookware';

const point = new Point(10, 20, 30);
const clone = point.clone();
point.set(5, 15, 25);

Pool

Object pool pattern for reusing instances.

import { Pool, Point } from '@benjos/cookware';

class PointPool extends Pool<Point> {
  constructor() {
    super(Point, 10); // Pre-populate with 10 instances
  }
}

const pool = new PointPool();
const point = pool.get();
// Use point...
pool.release(point);

class MyClass{
  public pool = new Pool(Point, 10) // Pre-populate with 10 instances
}
const myClass = new MyClass();
myClass.pool.get();

Utils (Singletons ready to use)

AssetUtils

Manage asset paths with configurable base path.

import { AssetUtils } from '@benjos/cookware';

// Optional: set custom base path
AssetUtils.Init('./myAssetsFolder/');

const imagePath = AssetUtils.GetPath('logo.png'); // "./myAssetsFolder/logo.png"

DomUtils

DOM manipulation helpers.

import { DomUtils } from '@benjos/cookware';

const app = DomUtils.GetApp();       // Gets or creates #app or #root
const loader = DomUtils.GetLoader(); // Gets or creates #loader

License

ISC