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

fysx

v0.0.4

Published

Extensible 2D Physics Library for the Web & Node

Readme

import * as FYSX from 'fysx';

// Create a world
const world = new FYSX.World();

// Enable the world border and set it's size
world.hasBorders = true;
world.width = 800;
world.height = 600;

// Populate the world with randomly positioned bodies
const size = new FYSX.Vec2(50, 50);
for (let i = 0; i < 50; i++) {
  const pos = new FYSX.Vec2(
    (world.width  - size.x) * Math.random(),
    (world.height - size.y) * Math.random()
  );
  const body = FYSX.createRectangleBody(pos, size);
  world.addBody(body);
}

// Simulate the world for a bit
for (let i = 0; i < 100; i++) {
  world.frame();
}

Install

npm i fysx

Getting Started

Check out the examples in the examples folder.

Overview

FYSX's physics algorithm is based on Verlet integration.

Vertex

A Vertex is a single particle in space. It has a position and a previous position (which is used to calculate it's velocity).

Constraint

A Constraint is a "connection" between one or more vertices. They come in different types. They usually apply a force to one or more of the "connected" vertices depending on their current state.

Types of constraints:

  • Distance Constraint: Tries to keep two vertices at a constant distance for each other by pushing/pulling them towards/from one another.
  • Leash Constraint: Force one vertex to stay within a radius of the other vertex by pulling the vertex inside the radius when it's outside.
  • Pin Constraint: Pins a vertex to a point in space. The vertex is forced to stay at that point at all times.

Edge

An Edge is a "solid" line between two vertices. Edges and vertices are the only things that can collide with each other (a collision is always between an edge and a vertex).

Body

Body is a group of vertices, constraints and edges.

World

A World is where all the vertices, constraints, edges and bodies live. Only physical objects in the same world can interact with each other.

Links

npm page