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

js-waves-particles

v1.0.3

Published

A lightweight, canvas-based wave and particle animation library with mouse-reactive effects. Perfect for adding a subtle, organic feel to backgrounds in web projects.

Downloads

608

Readme

js-waves-particles

A lightweight, high-performance canvas animation engine for organic wave and particle effects.

NPM Version License Bundle Size

View Live Demo & Playground

Changelog

Key Features

  • Multiple Wave Layers: Smooth, sine-based wave animations with customizable amplitude, frequency, and speed.
  • Floating Particles: Dynamic particle system with pulsing opacity and mouse-repulsion.
  • Mouse/Touch Reactive: Waves and particles respond to cursor movements and touch events with smoothed interpolation.
  • Fully Customizable: Override colors, gradients, and animation parameters via a simple config object.
  • Zero Dependencies: Pure JavaScript, lightweight, and framework-agnostic.
  • Fully Typed: Shipped with TypeScript definitions for an excellent developer experience.

Installation

To install the package in your project:

npm install js-waves-particles

Quick Start

1. Modern Bundlers (ESM)

Perfect for React, Vue, Angular, and Next.js.

import WaveParticles from 'js-waves-particles';

// Automatically creates a full-screen canvas behind your content
const animation = new WaveParticles();

// Cleanup (important for Single Page Applications)
// animation.destroy();

2. Browser / Script Tag


<script src="path/to/dist/wave-particles.iife.js"></script>
<script>
    const animation = new WaveParticles();
</script>

Configuration

You can pass a configuration object to the constructor to customize the visual engine.

const animation = new WaveParticles({
    canvas: '#my-canvas', // Optional: selector or HTMLCanvasElement
    config: {
        waves: [
            {
                amplitude: 80,
                frequency: 0.002,
                speed: 0.004,
                yOffset: 0.5,
                color: 'rgba(200, 100, 100, 0.2)',
                layers: 3
            }
        ],
        particles: {
            countScale: 5000, // Pixels per particle (lower = denser)
            maxCount: 300     // Maximum limit
        },
        colors: {
            backgroundGradient: ['#ffffff', '#f0f0f0'],
            particleColorPrefixes: ['rgba(255, 0, 0,'] // Alpha is managed automatically
        }
    }
});

Framework Integration

React

import {useEffect} from 'react';
import WaveParticles from 'js-waves-particles';

export const Background = () => {
    useEffect(() => {
        const animation = new WaveParticles();
        return () => animation.destroy();
    }, []);

    return null;
};

Vue 3


<script setup>
    import {onMounted, onUnmounted} from 'vue';
    import WaveParticles from 'js-waves-particles';

    let animation;
    onMounted(() => {
        animation = new WaveParticles();
    });
    onUnmounted(() => {
        animation.destroy();
    });
</script>

API Reference

.start()

Resumes the animation loop and re-attaches event listeners.

.stop()

Pauses the animation loop and detaches listeners to save CPU cycles.

.resize()

Forces the engine to recalculate dimensions and redistribute particles. Handled automatically with debouncing on window resize.

.destroy()

The nuclear option. Stops animation, removes listeners, and cleans up the DOM (if auto-created).

License

MIT © 2026 Luis 'PlatinumBlade' Moniz