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

@zakkster/lite-vec

v1.0.0

Published

Zero-GC 2D vector math using the gl-matrix out-parameter pattern. Float32Array-backed, alias-safe, 35+ operations.

Readme

@zakkster/lite-vec

npm version npm bundle size npm downloads npm total downloads TypeScript Zero Dependencies License: MIT

Zero-GC 2D vector math. Float32Array-backed, alias-safe, 35+ operations.

Pre-allocate once. Compute forever. Zero garbage collection.

Why lite-vec?

| Feature | lite-vec | gl-matrix | three.js Vector2 | victor.js | |---|---|---|---|---| | Zero-GC operations | Yes (out param) | Yes | No (returns new) | No | | Alias-safe rotate | Yes | Yes | N/A | N/A | | rotateAround | Yes | No | No | No | | Float32Array backed | Yes | Yes | No (object) | No | | 2D focused | Yes | 2D+3D+4D | 2D+3D | 2D | | Steering-ready | Yes | No | No | No | | Bundle size | < 2KB | ~8KB | ~150KB (full) | ~4KB |

Installation

npm install @zakkster/lite-vec

Quick Start

import { vec2 } from '@zakkster/lite-vec';

// Allocate once (this is the only allocation)
const pos = vec2.create(100, 200);
const vel = vec2.create(5, -3);
const gravity = vec2.create(0, 9.8);

// In your 60fps loop — zero allocations:
vec2.scaleAndAdd(vel, vel, gravity, dt);  // vel += gravity * dt
vec2.add(pos, pos, vel);                   // pos += vel

Recipes

Particle Physics Loop

const pos = vec2.create(), vel = vec2.create(), acc = vec2.create();
vec2.set(acc, 0, 400); // gravity

function update(dt) {
    vec2.scaleAndAdd(vel, vel, acc, dt);
    vec2.add(pos, pos, vel);
    vec2.scale(vel, vel, 0.99); // drag
}

Wall Bounce

const normal = vec2.create(1, 0); // left wall normal
if (pos[0] < 0) {
    vec2.reflect(vel, vel, normal); // alias-safe
    pos[0] = 0;
}

Orbit Around Point

const center = vec2.create(400, 300);
// One call — alias-safe even when out === pos
vec2.rotateAround(pos, pos, center, angularSpeed * dt);

Steering: Move Toward Target

const target = vec2.create(mouseX, mouseY);
vec2.moveToward(pos, pos, target, maxSpeed * dt);

Speed Limit

vec2.clampMag(vel, vel, 0, MAX_SPEED);

All 35 Operations

Create: create, set, copy, zero Arithmetic: add, sub, scale, scaleAndAdd, mul, negate, abs Compare: min, max, floor, round Length: mag, magSq, distance, distSq Normalize: normalize, clampMag Products: dot, cross Rotation: rotate, rotateAround, angle, angleBetween, fromAngle, perp Interpolation: lerp, moveToward Reflection: reflect, project Comparison: equals, approxEquals, isZero Debug: str

License

MIT