
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
spawn-confetti
Advanced tools
🎉 Lightweight JavaScript confetti effect that spawns at the mouse position on demand.
A lightweight and highly configurable JavaScript library that spawns confetti on demand—perfect for adding celebration effects to buttons, clicks, or custom triggers on your website.

npm install spawn-confetti
confetti.js and add it to your project folder<script src="path/to/confetti.js" type="module"></script>
The spawnConfetti() function has the following arguments:
amount(number) – Number of confetti particles to spawn.
Default: 30
x, y(number | string) – Spawn coordinates.
Default: mouse coordinates
Accepted string values:
mouse – spawn at mouse coordinatecenter – spawn at center coordinate of pagemax – spawn at max coordinate of pagevelXRange, velYRange(array) – Initial velocity range.
Default: [-5, 5], [-8, 0]
angVelXRange, angVelZRange(array) – Constant rotational velocity range.
Default: [0, 0], [6, 12]
lifetime(number) – Lifetime of particles in milliseconds.
Default: 2000
Example:
// Spawn 30 confetti particles at the current mouse position
spawnConfetti();
// Custom configuration
spawnConfetti({
amount: 75,
x: 'center',
y: 'max',
velXRange: [-20, 20],
velYRange: [-10, -3],
angVelXRange: [1, 0],
angVelZRange: [5, 15],
lifetime: 500
});
There are a few global configurations that you can modify:
acceleration(vector) – Controls gravity direction.acceleration.x = ..., acceleration.y = ...maxVel(vector) – Sets maximum velocity.maxVel.x = ..., maxVel.y = ...drag(vector) – Affects air resistance. Lower values = more drag.drag.x = ..., drag.y = ...colors(array) – List of colors to randomly assign to particles.shapes(array of svg strings) – Shapes for particles to randomly select from.<rect x="5" y="0" width="6" height="16"/>,
<path width="16" height="16" d="M0,12 Q4,4 8,12 Q12,20 16,12" stroke-width="5" fill="none"/>,
<circle cx="9" cy="9" r="5.5"/>,
<polygon points="9,2.072 17,15.928 1,15.928"/>
âť— Note: When adding new custom SVG shapes, ensure that any
<path>elements includefill="none"to render correctly.
License: MIT
Contributing: Contributions welcome! Please feel free to submit a Pull Request.
FAQs
🎉 Lightweight JavaScript confetti effect that spawns at the mouse position on demand.
The npm package spawn-confetti receives a total of 0 weekly downloads. As such, spawn-confetti popularity was classified as not popular.
We found that spawn-confetti demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.