Skip to content

js: v0.1.0

Choose a tag to compare

@github-actions github-actions released this 29 Sep 13:13
c2bd6dd

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: 1

Highlights

  • 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 & , x vs / + with and, uses the leftmost feat marker, keeps the joiners so format() can rebuild the string, and never splits AC/DC, 2 Unlimited or Blink-182. Names that must never be split go in knownArtists.
  • 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. parse never 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.0

npm: https://www.npmjs.com/package/trackparse/v/0.1.0 · implements spec 0.1.0 (SPEC.md)