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

@utilspalooza/core

v0.1.0

Published

Readable TypeScript math helpers for creative coding, canvas animation, and visual experiments.

Readme

@utilspalooza/core

Utilspalooza is a small TypeScript toolkit of readable math helpers for creative coding, canvas animation, and visual experiments.

It is not a timeline engine and it is not trying to replace GSAP. The package is for the small bits of motion math you reach for when making canvas toys, generative art, game-ish interactions, educational animations, or visual demos: interpolation, easing, vectors, geometry, collision checks, flocking, and tiny time-driven animation helpers.

No React, no canvas dependency, no runtime dependencies. Just pure functions you can use, inspect, and adapt.

Install

npm i @utilspalooza/core
import { circleToCircle, distance, lerp } from "@utilspalooza/core";

distance({ x: 0, y: 0 }, { x: 3, y: 4 }); // 5
lerp(0, 100, 0.5); // 50
circleToCircle(0, 0, 10, 15, 0, 10); // true

CommonJS works too:

const { distance } = require("@utilspalooza/core");

Import Strategy

Root imports are the recommended public API:

import { easeOutCubic, pingPong, tweenObject } from "@utilspalooza/core";

Subpath imports are also supported for examples, focused bundles, and people who prefer module-level imports:

import { easeOutCubic } from "@utilspalooza/core/Easing";
import { tweenObject } from "@utilspalooza/core/Animate";

Legacy migration helpers are intentionally not exported from the root barrel. Import them explicitly if you are moving older code over:

import { centerOnStage, legacyCosWave } from "@utilspalooza/core/legacy";

Recipes

Move a Point Toward the Mouse

import { moveToward } from "@utilspalooza/core";

const dot = { x: 0, y: 0 };
const mouse = { x: 240, y: 120 };

moveToward(dot, mouse, 4);

Bounce a Ball Inside a Rectangle

import { ballBounce } from "@utilspalooza/core";

const ball = { id: "ball", x: 80, y: 40, vx: 2, vy: 0, radius: 12, color: "#fff" };
const stage = { x: 0, y: 0, width: 640, height: 360 };

ballBounce(ball, stage);

Create a Looping Yoyo Animation

import { easeOutCubic, lerp, ticker, yoyo } from "@utilspalooza/core";

const stop = ticker(({ elapsed }) => {
  const t = yoyo(elapsed, 900);
  const x = lerp(0, 300, easeOutCubic(t));
  drawBall(x, 100);
});

// later
stop.cancel();

Sample an Object Tween

import { easeInOutCubic, tweenObject } from "@utilspalooza/core";

const frame = tweenObject(
  {
    x: { from: 0, to: 300 },
    y: { from: 100, to: 40 },
    alpha: { from: 0, to: 1 },
  },
  elapsedMs,
  800,
  easeInOutCubic,
);

Reflect Velocity Off a Wall

import { vecReflect } from "@utilspalooza/core";

const velocity = { x: 4, y: -6 };
const floorNormal = { x: 0, y: 1 };

const bounced = vecReflect(velocity, floorNormal);

Detect Circle/Rectangle Collision

import { circleToRect } from "@utilspalooza/core";

const hit = circleToRect(ball.x, ball.y, ball.radius, wall.x, wall.y, wall.width, wall.height);

What's Inside

  • Interpolation and ranges: lerp, inverseLerp, mapRange, clamp, wrap, pingPong
  • Easing and smooth curves: linear, easeInOutCubic, easeOutBounce, smoothstep, smootherstep
  • Tiny animation helpers: ticker, tweenValue, tweenObject, springValue, loop, yoyo, delay, stagger
  • Vectors: vecAdd, vecScale, vecNormalize, vecReflect, vecLerp, vecLimit
  • Geometry and trig: distance, lineLength, getPointOnLine, getRotation, circleFromThreePoints, starVertices
  • Collision detection: circle, rectangle, line, polygon, and object-shaped collision helpers
  • Motion and simulation: moveToward, moveAlongLine, ballBounce, ballToBallBounce, boidsStep
  • Visual math extras: dft, gameOfLifeStep, waveAmplitude, lensDeflection, sphereLighting

Everything in the root barrel is a named export, and the package is marked side-effect-free so bundlers can tree-shake unused helpers.

Use From a CDN

Drop a <script> tag on any page and call functions off the Utilspalooza global:

<script src="https://cdn.jsdelivr.net/npm/@utilspalooza/core"></script>
<script>
  console.log(Utilspalooza.distance({ x: 0, y: 0 }, { x: 3, y: 4 }));
</script>

Pin a version for production:

<script src="https://cdn.jsdelivr.net/npm/@utilspalooza/[email protected]"></script>

unpkg serves the same browser bundle:

<script src="https://unpkg.com/@utilspalooza/core"></script>

TypeScript

Types ship with the package. Shared shapes like Point, Vector, Circle, Line, Polygon, Container, and Ball are exported alongside the functions.

License

MIT