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

sonicfx

v1.0.0

Published

Audio-reactive CSS visual effects for DOM: dynamic gradients, CSS filters, glow borders and overlays driven by music stem energy. Zero dependencies.

Readme

🎨 SonicFX

Audio-Reactive Visual Effects Library for DOM Elements

npm bundle size npm version License: MIT

SonicFX is a JavaScript frontend library that applies advanced audio-reactive CSS visual effects to DOM elements: dynamic gradients, CSS filters, glowing borders, and overlay animations — all driven by real-time audio energy analysis.

Designed to work seamlessly with SonicMotion, or any audio data source that provides { stemName: { value, bands } } per frame.


✨ Features

  • 🎨 Instrument Presets: Ready-made presets for bass, drums, vocals, and "other" stems — no configuration needed.
  • 🌈 Dynamic Gradients: Radial pulses, multi-layer gradients and color shifts driven by audio energy.
  • 🔦 CSS Filter Effects: brightness, hue-rotate, contrast and filter chains that react to sound frequency.
  • 💡 Border Animations: Glowing, pulsing and rainbow borders synced to the beat.
  • 🖥️ Overlay Controller: Full-screen audio-reactive overlay layers on demand.
  • 🧩 Declarative HTML API: Add data-sonicfx attributes and call parseDOM() — zero JS config required.

💻 Installation

npm install sonicfx
import SonicFX from 'sonicfx';

🚀 Quick Start

Option 1: Declarative HTML (Easiest)

<!-- Reacts to bass energy with a dynamic gradient -->
<div data-sonicfx="bassPulse" data-sonicfx-track="bass">
  Bass Section
</div>

<!-- Glow border driven by vocals -->
<h1 data-sonicfx="borderGlow" data-sonicfx-track="vocals" data-sonicfx-color="#ff00ff">
  Vocals Title
</h1>
import SonicFX from 'sonicfx';

const fx = SonicFX.create();

// Connect to SonicMotion (or any frame data source)
sonic.onFrame((data) => {
    fx.setDataSource(() => data);
});

fx.parseDOM();
fx.start();

Option 2: JavaScript API

import SonicFX from 'sonicfx';

const fx = SonicFX.create();

fx.setDataSource(() => currentFrameData);

// Bind elements to presets
fx.bind('#kick-element', 'drumsHit', { stem: 'kick', band: 'bass' });
fx.bind('#bass-element', 'bassPulse', { stem: 'bass', color: '#7928ca' });
fx.bind('#vocals-element', 'borderGlow', { stem: 'vocals', intensity: 1.5 });

fx.start();

🎭 Available Presets & Effects

Instrument Presets (via data-sonicfx or JS)

| Preset | Description | |---|---| | bassPulse | Deep pulsing gradient for bass/low-end stems | | drumsHit | Sharp flash effect for percussion hits | | vocalsWave | Smooth color wave for vocal stems | | otherFlow | Fluid color flow for melodic instruments |

Gradient Effects

| Effect | Description | |---|---| | dynamicGradient | Color gradient that shifts with audio value | | radialPulse | Radial glow expanding from center | | multiLayerGradient | Complex multi-stop gradient animation |

CSS Filter Effects

| Effect | Description | |---|---| | brightnessReactive | Brightness that increases with energy | | hueShift | Rotates the hue of the element | | contrastPop | Contrast burst on audio peaks | | filterChain | Apply multiple filters simultaneously |

Border Effects

| Effect | Description | |---|---| | borderPulse | Border width/opacity pulsed by audio | | borderGlow | Glowing box-shadow synced to energy | | borderRainbow | Rainbow hue-cycling border |


📐 HTML Attributes

| Attribute | Values | Description | |---|---|---| | data-sonicfx | any preset name | Effect to apply | | data-sonicfx-track | stem name | Audio stem to read energy from | | data-sonicfx-band | bass, mid, treble | Frequency band to isolate | | data-sonicfx-color | CSS color string | Base color for the effect | | data-sonicfx-intensity | 0.02.0 | Multiplies the effect magnitude |


🔌 JavaScript API

const fx = SonicFX.create();

fx.setDataSource(fn)   // Set frame data source function
fx.bind(selector, preset, config)  // Bind element to effect
fx.parseDOM()          // Auto-parse [data-sonicfx] elements
fx.createOverlay(config)  // Create full-screen overlay
fx.start()             // Start animation loop
fx.stop()              // Stop and reset all elements
fx.unbindAll()         // Remove all bindings
fx.destroy()           // Clean up all resources

🎵 Works Best With

  • sonicmotion — Audio stem analysis and DOM animation engine
  • sonicscroll — Scroll-triggered animations with audio-aware mode
  • sonicwave — Canvas waveform and spectrum visualizations

📄 License

MIT © 2025 axscq