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 🙏

© 2025 – Pkg Stats / Ryan Hefner

entropy-particles

v2.1.1

Published

A lightweight and configurable JavaScript particle engine for creating dynamic, colorful, and chaotic visual effects. Features multi-system control, event listeners, curvature-based motion, and persistent state storage. Ideal for chaotic movements and pat

Downloads

28

Readme

entropy-particles

npm License PRs Welcome

EntropyParticles two layer Galaxy & Space preview

A lightweight and configurable JavaScript particle engine for creating dynamic, colorful, and chaotic visual effects.

ParticlesJS allows you to easily create and manage particle systems using simple configuration objects.
It supports multiple emitters, motion curvature, interactive listeners, and persistent state storage — all powered by plain, and dependency-free, JavaScript.

Features

  • JSDoc documentation — methods and properties are well documented for a better use
  • TypeScript support — supports type imports
  • Configurable systems — control every property via simple JSON-like configs.
  • Dynamic colors — supports arrays of color values or gradients.
  • Curvature motion — add natural or chaotic motion through curve parameters.
  • Event listeners — trigger resets, spawns, and effects using keyboard or external events.
  • Persistent storage — save and restore spawners/targets using sessionStorage or localStorage.
  • Ease download of storage points — save targets and spawners points direct into a JSON file for future use
  • Lightweight — zero dependencies, runs directly in the browser.

Installation

Using npm:

npm install entropy-particles

Using bun:

bun install entropy-particles

Or include it manually (file can be found in the dist folder):

<script src="lib/entropy-particles.js"><script>

Basic Usage with JS + JSDoc

import EntropyParticles from "entropy-particles";

/** @typedef {import("entropy-particles").EntropyParticlesConfig} EntropyParticlesConfig */

const particles = new EntropyParticles();

/** @type {EntropyParticlesConfig} */
particles.config = {
    canvas: {
        id: "particles",
        appendTo: document.body,
        size: { width: window.innerWidth, height: window.innerHeight },
        backgroundColor: "black",
    },
    particles: {
        quantity: 2000,
        color: ["red", "rbga(155,155,155,0.5)", "hsl(220,100%,50%)", "#0F0"],
        velocity: 0.25,
        lifespan: 2 * 60,
        maxLifespan: 3 * 60,
        spreadFactor: 3,
        curvature: {
            curve: 15,
            axisCurve: { x: 30, y: 5 },
        },
    },
    listeners: {
        resetPositions: "r",
        spawners: { keyboardTrigger: "Control" },
        targets: { keyboardTrigger: "Shift" },
    },
    storage: {
        storageType: "localStorage",
        storeNewPositions: { spawners: true, targets: true },
        storeListenersPositions: { spawners: true, targets: true },
    },
};

particles.start();

Basic Usage with TS + React

import { useRef, useEffect } from "react";

import EntropyParticles from "entropy-particles";
import type { EntropyParticlesConfig } from "entropy-particles";

export default function Particles() {
    const divRef = useRef<HTMLDivElement>(null);

    useEffect(() => {
        const divCurrent = divRef.current!;

        const particles = new EntropyParticles();

        const pConfig: EntropyParticlesConfig = {
            canvas: {
                id: "particles",
                appendTo: divCurrent,
                backgroundColor: "transparent",
                size: { width: divCurrent.clientWidth, height: divCurrent.clientHeight },
                threshold: divCurrent.clientWidth * 0.2,
            },
            particles: {
                quantity: 1_000,
                color: ["red", "purple", "pink"],
            },
        };

        particles.config = pConfig;
        particles.start();
    }, []);

    return <div ref={divRef} className="absolute z-[-10] h-dvh w-dvw"></div>;
}

Example: Dual Particle Systems

You can run multiple particle systems simultaneously for layered or mixed effects. Full example code in the demo/script.js file.

import EntropyParticles from "entropy-particles";

const pSpace = new EntropyParticles();
const pGalaxy = new EntropyParticles();

pSpace.config = {
    /* background stars */
};
pGalaxy.config = {
    /* colorful vortex */
};

pSpace.start();
pGalaxy.start();

License

MIT © 2025 Gustavo L. Gregorio