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

codesong

v0.2.0

Published

Code songs, render audio — a declarative TypeScript/JSX music framework.

Readme

🎵 Codesong

Code songs, render audio. Describe a song, write it as declarative TypeScript/JSX, and render a listenable audio file. Built to be written by an agent (Claude Code) and iterated with a tight feedback loop — components in, sound out.

npx create-codesong@latest my-song   # scaffold a project
cd my-song && npm run render          # song.tsx -> out.wav
export default (
  <Song title="Sunny Backroads" tempo={124} keySignature="G major">
    <Section name="verse" bars={8}>
      <Track instrument="acoustic-guitar" reverb={0.18} loop>
        <Progression chords={["G", "C", "G", "D"]} dur="1n" strum="down" />
      </Track>
      <Track instrument="bass" octave={2} loop>
        <Progression chords={["G", "C", "G", "D"]} dur="1n" voicing="root5" />
      </Track>
      <Track instrument="drums" loop>
        <Pattern steps="bd ~ sd ~ bd bd sd ~" dur="8n" />
      </Track>
    </Section>
  </Song>
);
$ codesong render song.tsx -o out.wav
♪ Sunny Backroads — 124 BPM, 4/4, key G major
  duration 41.2s | peak -1.0 dBFS | RMS -12.1 dBFS
  detected key: G major (conf 0.985) ✓
  sections: intro → verse → chorus
  no issues ✓

Why this works

Codesong is thin orchestration over proven open source. The hard part isn't DSP — it's the authoring model and the agent feedback loop. The pipeline:

| Stage | What it does | |---|---| | declarative TS/JSX song | you (or the agent) write a component tree | | music IR | compiles to a tick-based note/event timeline | | instruments | synthesis on the Web Audio graph | | mix/master + encode | sums tracks, normalizes, writes WAV/MP3 | | Codesong Studio | live browser preview of the same engine |

Develop this repo

npm install
npm run render -- examples/cheerful-country/song.tsx -o out.wav   # render + analysis report
npm run preview                                                   # live studio at :5174
npm test                                                          # unit + render integration
npx tsx src/cli/index.ts presets                                  # list instruments
npm run build                                                     # build dist/ for publishing

No external sample packs or native binaries required — instruments are synthesized directly on the Web Audio graph (via node-web-audio-api), so it renders out of the box at ~9× real time.

How it's built

song.tsx ─compile→ ScoreIR ─schedule→ Web Audio graph ─render→ AudioBuffer ─→ WAV/MP3
                                                                          └→ report.json (analysis)
  • src/core — JSX runtime (no React), music IR, tonal-backed theory helpers, compile().
  • src/instruments — data-driven synth presets + a synthesized drum kit.
  • src/rendererengine.ts schedules a score onto any Web Audio context (shared by the Node offline renderer and the browser preview); render.ts renders + normalizes + encodes.
  • src/analyze — symbolic validation + audio features (loudness, clipping, key estimate) → the report the agent reads to self-correct.
  • src/clirender / presets / init.
  • src/preview — Vite studio: live playback, transport, section map, hot reload.

See CODESONG.md for the full authoring API (the agent guide).

Status & roadmap

Working today: declarative authoring, full render pipeline, analysis/feedback loop, live preview, genre examples (country, lo-fi, blues piano, an epic-minor theme), deterministic renders, green tests + typecheck, and a publishable package + create-codesong scaffolder.

Next: SoundFont/SFZ sampler backend (FluidSynth/sfizz) for acoustic realism; MIDI/MusicXML export; loudness-normalized MP3; more genre presets; and an optional vocals plugin (DiffSinger/NNSVS) — deferred because it needs Python + ML models + voicebanks.