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

@nleidman/particular

v0.3.0

Published

Particular is a simple library for rendering particle effects. It uses WebGL2 and supports running in workers.

Readme

Particular

Words of caution: this is a work in progress.

Please be aware that some APIs may change, and some functionality may not be implemented yet.

Particular is a simple library for rendering particle effects. It uses WebGL2 and supports running in workers.

Installing

To install the library, run:

npm install particular

Usage

Basic setup of a particle system:

import { Engine, Emitter, Scene, TextureLoader } from 'particular';

const engine = new Engine(canvas, { x: window.innerWidth, y: window.innerHeight });

const scene = new Scene(engine);

const emitter = new Emitter(engine, { texture: texture, is2d: true});

scene.add(emitter);

engine.addScene(scene);

engine.start();

emitter.emit({
  // particle batch options
});

Particle Batch Options

export interface ParticleBatchOptions {
  /** Lifetime of a particle batch in **ms**, batch will be disposed of after `lifeTime` + `spawnDuration` */
  lifeTime: number;
  /** Number of particles in the batch */
  count: number;
  /** Size of a particle in **pixels** */
  size: number;
  /**
   * Aspect ratio of the particle.
   * @default 1
   */
  aspectRatio?: number;
  /** Origin of the particle in **pixels**, relative to the top left corner*/
  origin: { x: number; y: number };
  /** Initial velocity of the particle in **pixels/s**. Each particle in a batch will receive a random velocity between `-v0` and `v0` */
  v0: { x: number; y: number; z: number };
  /**
   * Velocity bias of a particle in fractions of `v0` for each axis.
   * Used to skew velocity distribution.
   * For example, if v0 is 10 px/s and velocity bias is 0, particle velocity will be between -10 and 10 px/s.
   * If velocity bias is 0.5, particle velocity will be between -5 and 15 px/s.
   *
   * @default { x: 0, y: 0, z: 0 }
   */
  velocityBias?: { x: number; y: number; z: number };
  /**
   * Initial angular velocity of the particle in **radians/s**.
   * Each particle in a batch will receive a random velocity between `-omega0` and `omega0`.
   */
  omega0: number;
  /** Gravity of the particle batch in **pixels/s^2** */
  gravity: { x: number; y: number; z: number };
  /**
   * Period of time during which particles will spawn. In **ms**
   * @default 0
   */
  spawnDuration?: number;
  /** Drag coefficient of a particle. Used for fluid simulation */
  Cd: number;
  /** Angular drag coefficient of a particle. Used for fluid simulation */
  Cr: number;
  /** Density of a fluid the particle is moving through. In **kg/kpx^3**. Used for fluid simulation */
  density: number;
  /** Cross-sectional area of a particle. In **px^2**. Used for fluid simulation */
  area: number;
  /** Mass of a particle. In **kg**. Used for fluid simulation */
  mass: number;
  /** Moment of inertia of a particle. In **kg*px^2**. Used for fluid simulation */
  momentOfInertia: number;
  /**
   * Offset of the texture in the atlas
   * @default { column: 0, row: 0 }
   */
  atlasTextureOffset: { column: number; row: number };
  /**
   * Amount of scaling applied to a particle based on its age.
   * @default 0
   */
  scaleWithAge: number;
  /**
   * Diameter of a spawn area in **pixels**.
   * */
  spawnSize: number;
}