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

sonicwave

v1.0.0

Published

Canvas audio waveform visualizer, interactive equalizer bars and frequency spectrum display. WaveSurfer.js alternative. Zero dependencies.

Readme

🌊 SonicWave

Canvas-Based Audio Waveform & Spectrum Visualization Library

npm bundle size npm version License: MIT

SonicWave is a zero-dependency JavaScript library for rendering beautiful audio waveform visualizations, interactive equalizer bars, and frequency spectrum displays using the HTML5 Canvas API. A lightweight, modern alternative to WaveSurfer.js.

Use it standalone or pair it with SonicMotion to create real-time audio-reactive Canvas visuals driven by live music stem analysis.


✨ Features

  • 🎵 Waveform Renderer: Draw audio waveforms from AudioBuffer or real-time frequency data — replaces WaveSurfer.js.
  • 🎚️ Equalizer Bars: Animated, color-coded frequency bars for bass, mid and treble ranges.
  • 📊 Spectrum Display: Full frequency spectrum visualization with configurable colors and bar counts.
  • 🎨 Fully Customizable: Colors, bar counts, smoothing, gradients and canvas size — all configurable.
  • Zero Dependencies: Pure Canvas API, no external libraries required.
  • 🔗 SonicMotion Compatible: Feed real-time stem data directly into any SonicWave renderer.

💻 Installation

npm install sonicwave
import SonicWave from 'sonicwave';

🚀 Quick Start

Equalizer Bars

<canvas id="eq-canvas"></canvas>
import SonicWave from 'sonicwave';

const eq = SonicWave.createEqualizer({
    canvas: document.getElementById('eq-canvas'),
    bars: 32,
    color: '#7928ca',
    backgroundColor: '#0a0a0a'
});

// Feed real-time data from SonicMotion
sonic.onFrame((data) => {
    eq.update(data.bass.bands);  // { bass, mid, treble }
});

Frequency Spectrum

<canvas id="spectrum-canvas"></canvas>
const spectrum = SonicWave.createSpectrum({
    canvas: document.getElementById('spectrum-canvas'),
    barCount: 64,
    colors: {
        bass: '#ff0080',
        mid: '#7928ca',
        treble: '#00d4ff'
    }
});

sonic.onFrame((data) => {
    spectrum.update(data);
});

Waveform Renderer (Static)

const waveform = SonicWave.createWaveform({
    canvas: document.getElementById('waveform-canvas'),
    color: '#00d4ff',
    backgroundColor: '#111'
});

// Render from AudioBuffer
const response = await fetch('/audio/master.mp3');
const arrayBuffer = await response.arrayBuffer();
const audioBuffer = await audioContext.decodeAudioData(arrayBuffer);
waveform.renderBuffer(audioBuffer);

⚙️ Configuration Options

createEqualizer(config)

| Option | Default | Description | |---|---|---| | canvas | required | HTMLCanvasElement to render on | | bars | 32 | Number of equalizer bars | | color | '#7928ca' | Bar fill color (or gradient array) | | backgroundColor | '#000' | Canvas background | | gap | 2 | Pixel gap between bars | | smoothing | 0.8 | Smoothing factor (0–1) | | mirror | false | Mirror bars from center |

createSpectrum(config)

| Option | Default | Description | |---|---|---| | canvas | required | HTMLCanvasElement to render on | | barCount | 64 | Number of frequency bars | | colors | { bass, mid, treble } | Color per frequency band | | backgroundColor | '#000' | Canvas background | | smoothing | 0.75 | Smoothing factor (0–1) |

createWaveform(config)

| Option | Default | Description | |---|---|---| | canvas | required | HTMLCanvasElement to render on | | color | '#00d4ff' | Waveform stroke color | | backgroundColor | '#000' | Canvas background | | lineWidth | 2 | Waveform stroke width |


🔌 JavaScript API

// Equalizer
const eq = SonicWave.createEqualizer(config);
eq.update(bandsData)  // { bass, mid, treble } values 0–1
eq.resize()           // Call on window resize
eq.destroy()          // Clean up canvas

// Spectrum
const spectrum = SonicWave.createSpectrum(config);
spectrum.update(frameData)  // Full frame data object
spectrum.resize()
spectrum.destroy()

// Waveform
const waveform = SonicWave.createWaveform(config);
waveform.renderBuffer(audioBuffer)   // Render from AudioBuffer
waveform.renderLive(frequencyData)   // Render from real-time byte array
waveform.clear()
waveform.destroy()

🎵 Works Best With

  • sonicmotion — Audio stem analysis and DOM animation engine
  • sonicfx — Advanced audio-reactive visual effects
  • sonicscroll — Scroll-triggered animations with audio-aware mode

📄 License

MIT © 2025 axscq