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

canvas-snowfall

v1.2.3

Published

A lightweight HTML5 Canvas snowfall animation library

Readme

Canvas Snowfall

A lightweight and customizable HTML5 Canvas-based snowfall animation library. Create beautiful snow effects for your web projects with minimal setup.

Features

  • 🎨 Pure Canvas-based rendering for optimal performance
  • ⚡️ Lightweight with zero dependencies
  • 🎮 Real-time customization of snowfall parameters
  • 📱 Responsive and mobile-friendly
  • 🎯 Easy to integrate with any web project

Live Demo

Check out the live demo of the snowfall effect here: Example Page

Installation

npm install canvas-snowfall

Usage

Using ES Modules

import { SnowfallCanvas } from 'canvas-snowfall';

// Get your canvas element
const canvas = document.getElementById('snowfall');

// Initialize snowfall
const snowfall = new SnowfallCanvas(canvas);

// Start the animation
snowfall.start();

Using UMD Bundle (Direct Browser Usage)

You can include the library directly in your HTML using one of these methods:

Using CDN

<!-- Production (minified) -->
<script src="https://cdn.jsdelivr.net/gh/Garapov/snowfall@main/dist/snowfall.umd.min.js"></script>

<!-- Development (unminified) -->
<script src="https://cdn.jsdelivr.net/gh/Garapov/snowfall@main/dist/snowfall.umd.js"></script>

Download Source

You can download the latest release (v1.2.1) directly:

After downloading, include the library in your HTML:

<script src="path/to/snowfall.umd.min.js"></script>

Then use it in your JavaScript:

const canvas = document.getElementById('snowfall');
const snowfall = new SnowfallCanvas(canvas);
snowfall.start();

For development, you can use the unminified version:

<script src="path/to/snowfall.umd.js"></script>

HTML Setup

<canvas id="snowfall"></canvas>

Configuration Options

You can customize the snowfall by passing options when initializing:

const options = {
    count: 100,          // Number of snowflakes
    minRadius: 2,        // Minimum snowflake radius
    maxRadius: 5,        // Maximum snowflake radius
    minSpeed: 1,         // Minimum falling speed
    maxSpeed: 3,         // Maximum falling speed
    wind: 0,            // Wind effect (-2 to 2)
    color: 'white',     // Snowflake color
    opacity: 0.8        // Snowflake opacity
};

const snowfall = new SnowfallCanvas(canvas, options);

Dynamic Updates

You can update options on the fly:

// Update single or multiple options
snowfall.updateOptions({
    count: 200,
    wind: 1.5
});

Control Methods

// Start animation
snowfall.start();

// Stop animation
snowfall.stop();

// Resize handler is automatic, but you can call it manually if needed
snowfall.resize();

Example

Check out the examples directory for a complete demo with interactive controls. The example demonstrates how to:

  • Create a fullscreen snow effect
  • Add controls for snowflake count, wind effect, and speed
  • Handle window resizing

Browser Support

Works in all modern browsers that support HTML5 Canvas:

  • Chrome
  • Firefox
  • Safari
  • Edge

License

MIT License - feel free to use in your projects!