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

confetti-cannons

v0.2.1

Published

Adds a confetti cannon effect to any page!

Readme

🎉 confetti-cannons 🎉

Github

https://github.com/sjlevens/confetti-cannon

Elevate your web celebrations!

Looking to bring some extra sparkle and joy to your web application? Want to surprise your users with a virtual celebration they'll never forget? confetti-cannons is here to make your web festivities unforgettable! With just one line of code, shower your web application with confetti 🎊

Installation

npm install confetti-cannons

Usage

It's simple! Import and fire away:

import confetti from "confetti-cannons";

// Whenever you want to celebrate
confetti();

This will blast confetti particles from the bottom of your screen. Who knew joy could be so few kb? 😄

Event Listener

import confetti from "confetti-cannons";

document.addEventListener("DOMContentLoaded", () => {
  const button = document.getElementById("celebrateButton");
  button.addEventListener("click", () => {
    confetti();
  });
});

Spawn from a cursor click!

import { attachConfettiToCursorClick } from "confetti-cannons";

attachConfettiToCursorClick();

React button handler

import React from "react";
import confetti from "confetti-cannons";

const CelebrationButton = () => {
  const handleButtonClick = () => {
    confetti();
  };

  return <button onClick={handleButtonClick}>Click me for Confetti!</button>;
};

export default CelebrationButton;

React useEffect Example

import React, { useEffect } from "react";
import confetti from "confetti-cannons";

const CelebrateOnLoad = () => {
  useEffect(() => {
    confetti();
  }, []); // Empty dependency array ensures it only fires once, on initial render

  return (
    <div>
      <h1>Welcome to the Party!</h1>
    </div>
  );
};

export default CelebrateOnLoad;

Options

You can customise the intensity and other configurations:

type Options = {
  zIndex?: number,
  cannonSpawns?: number[][],
  spread?: "cone" | "fountain",
};

// Blast with custom intensity and z-index
confetti(50, { zIndex: 1000 });

// This will place your confetti behind everything (careful if you use it in a drawer!)
confetti(50, { zIndex: -1 });

// Blast from specific cannon spawns (an array of 2d points)
confetti(20, { cannonSpawns: [[-0.5, 0.5]] });

How it Works

Under the hood, confetti-cannons uses WebGL to render performant confetti particles on your screen. Different shapes and colours add to the variety!

What's Next?

We're looking to add more customisation options for shapes, colours, and animations. Stay tuned!

Bugs & Contributions

Find a bug? Want to add a new feature? Your contributions are welcome! Open an issue or submit a PR.

License

MIT


Celebrate the small wins, the big moments, and everything in between! 🥳