Repository navigation
js: v0.1.0
First public release of trackparse, a parser that turns music track strings into structured metadata. The spec behind it is shared by every port.
import { parse } from "trackparse";
parse("01. Wilkinson ft. Becky Hill - Afterglow (Sub Focus VIP Remix) [Official Video]");
// artists: Wilkinson (primary), Becky Hill (featured, "ft.")
// title: "Afterglow"
// versions: remix by Sub Focus, modifiers ["vip"]
// junk: "Official Video" (video) · position: 1Highlights
- Extract, don't delete. Featured artists, remixers, producers, version type (remix, VIP, bootleg, extended, radio, original, live, remaster with year, sped up…), explicit/clean flags, track numbers, timestamps and junk ("Official Video", "4K", "Free Download") each come back as their own field, next to a clean title.
- Artists as a list. Splits on
&,xvs/+withand, uses the leftmost feat marker, keeps the joiners soformat()can rebuild the string, and never splitsAC/DC,2 UnlimitedorBlink-182. Names that must never be split go inknownArtists. - Modes for store titles, YouTube titles (pipes,
by, quoted titles, uploader fallback) and filenames. - Unicode-aware. NFC, every dash and bracket variant, Cyrillic, CJK and diacritics, with diacritic-insensitive dedup.
- Zero dependencies. ESM + CJS + TypeScript types, Node ≥ 18.
parsenever throws.
Spec 0.1.0
spec/SPEC.md: rules R0–R12 written to be portable (hand-written scanners, no regex lookaround), so the JS, Python and Rust ports can give byte-identical output.- 11,889 shared fixtures: 898 handwritten (including regressions from real-world parsers) and 10,991 from a combinatorial generator whose expected values are built from ground-truth atoms, not from the parser.
- The JS reference implementation passes all of them with an empty skip list.
Python (PyPI) and Rust (crates.io) ports are planned against the same fixtures.
Changelog
0.1.0 (2026-09-29)
Features
- initial trackparse spec, fixtures and js package (cf346e8)
Install
npm install trackparse@0.1.0npm: https://www.npmjs.com/package/trackparse/v/0.1.0 · implements spec 0.1.0 (SPEC.md)