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

@arraypress/waveform-gen

v1.3.0

Published

Generate waveform peak data from audio files. CLI and library for pre-computing waveform data for WaveformPlayer.

Downloads

389

Readme

Waveform Generator

Generate waveform peak data from audio files for WaveformPlayer and WaveformBar.

Pre-generated waveforms mean instant visualization — no client-side audio decoding needed.

Version License

Quick Start

# Run directly with npx
npx @arraypress/waveform-gen ./audio/*.mp3 --output ./waveforms/

# Or install globally
npm install -g @arraypress/waveform-gen

CLI Usage

# Generate JSON per audio file
waveform-gen ./audio/*.mp3 --output ./waveforms/

# Directory scan
waveform-gen ./audio/ --recursive --output ./waveforms/

# Custom sample count
waveform-gen ./audio/*.mp3 --output ./waveforms/ --samples 400

# Print peaks to stdout (for piping)
waveform-gen song.mp3 --format inline

Options

| Option | Default | Description | |-------------------|---------------|------------------------------| | --samples <n> | 1800 | Number of peaks to generate | | --precision <n> | 2 | Decimal places for rounding | | --output <dir> | Same as input | Output directory | | --format <type> | json | json or inline (stdout) | | --recursive | off | Scan directories recursively | | --quiet | off | Suppress progress output |

Output Format

{
  "peaks": [
    0.2,
    0.37,
    0.41,
    0.55,
    ...
  ]
}

With markers (auto-detected from sidecar file):

{
  "peaks": [
    0.2,
    0.37,
    0.41,
    0.55,
    ...
  ],
  "markers": [
    {
      "time": 0,
      "label": "Intro"
    },
    {
      "time": 30,
      "label": "Chorus"
    }
  ]
}

Markers

Place a .markers.txt file alongside the audio with the same name:

# song.markers.txt
0:00 Intro
0:30 Verse 1
1:15 Chorus
1:02:30 Bridge

Supports SS, MM:SS, and H:MM:SS timestamps. Lines starting with # are ignored. Markers are auto-detected — no flag needed.

Using with WaveformPlayer


<div data-waveform-player
     data-url="song.mp3"
     data-waveform="waveforms/song.json">
</div>

Using with WaveformBar


<div data-wb-play
     data-url="song.mp3"
     data-wb-waveform="waveforms/song.json">
</div>

Library Usage

npm install @arraypress/waveform-gen
import {generatePeaks} from '@arraypress/waveform-gen';

const {peaks} = await generatePeaks('./song.mp3', {
    samples: 1800,
    precision: 2
});

Supported Audio

MP3, WAV, FLAC, OGG, M4A, AAC

Requirements

Node.js 18+

Ecosystem

| Package | Description | |-------------------------------------------------------------------------|-------------------------------------------------------------------| | WaveformPlayer | Core audio player with waveform visualization | | WaveformBar | Persistent bottom-bar player with queue, favorites, cart, DJ mode | | WaveformGen | CLI tool to pre-generate waveform JSON from audio files | | WaveformPlaylist | Playlist and chapter support addon | | WaveformTracker | Audio engagement analytics |

License

MIT © ArrayPress