Repository navigation
js: v0.4.0
Tracklists pasted from Discord, Reddit, Telegram or YouTube comments often keep their list bullets and Markdown, and DJ sets mark a track played over the previous one with w/. 0.3 read none of that: the time was lost and the decoration ended up in artist names. 0.4.0 reads through it, in both packages.
import { applyEdits, parseTracklist } from "trackparse/tracklist";
const text = [
"* 00:00 Noisia - Stigma",
"**[**03:30**] Phace - Psycho**",
"w/ Mefjus - Sleepless (Acapella)",
"[07:10] **Imanu** - _Sacrifice_",
].join("\n");
const list = parseTracklist(text);
list.entries.map((e) => [e.time?.seconds ?? null, e.layered, e.track.artists[0].name, e.track.title]);
// [ [ 0, false, 'Noisia', 'Stigma' ],
// [ 210, false, 'Phace', 'Psycho' ],
// [ null, true, 'Mefjus', 'Sleepless' ],
// [ 430, false, 'Imanu', 'Sacrifice' ] ]
list.entries[1].parts; // { lead: '**[**', time: '03:30', gap: '**] ', rest: 'Phace - Psycho**' }
list.warnings; // []
applyEdits(text, [{ op: "shift", seconds: 15, from: 2 }]).text.split("\n")[1];
// '**[**03:45**] Phace - Psycho**'What's new
- List bullets before a time.
* 14:21 Artist - Title,- [01:02] Artist - Titleand• 1:02:03 - …keep their time. The bullet goes intolead. - Markdown emphasis.
**bold**,__underline__,*italic*and_italic_around the time, a name, a title or the whole line are read through. Nothing is removed fromraworparts: emphasis next to the time sits inleadandgap(so edits keep it), and the parser reads the rest of the line without it.- Next to the time, a run of one or two
*or_counts by its position, with or without a partner. Anywhere else, a*or_only counts when it has a partner on the line and its outer side is a space, a bracket, another*or_, or the line's end, soP*nk,*NSYNC,DJ_Name,Noisia_-_Stigmaand a censoredF**kstay as written. Backticks,~~and||are never Markdown. **Intro**is now a marker and**Part 2:**a header.
- Next to the time, a run of one or two
- Layered
w/lines. A line whose track text (after any time or bullet) starts withw/and whitespace is a track played over the previous one: the entry haslayered: true, and thew/no longer ends up in the first artist's name. An untimed layered line doesn't warntime-missing, and it doesn't break bare track numbering.
Upgrading
- Every tracklist entry has a new key,
layered(boolean). Code that checks the exact set of keys, or a schema copied from an older version, needs it added. - Plain lines, without bullets, Markdown or
w/, parse the same as in 0.3. On the private corpus of 5,031 real podcast tracklist lines, the output is identical to 0.3.3 apart fromlayered: false. parse()for single tracks is unchanged in every mode.trackparse/tracklistnow adds about 8.3 KiB gzipped (was 7.6 KiB); the CI budget is 9 KiB.
Changelog
0.4.0 (2026-11-10)
Features
- spec: accept a list bullet before a tracklist time (e926348)
- spec: layered "w/" lines in tracklists (7fbb7f1)
- spec: read Markdown emphasis in tracklists (888bc9e)
Bug Fixes
- spec: pair Markdown emphasis only inside rest (942d5a9)
Documentation
- describe emphasis next to the time and layered lines as the spec does (d5c0c6c)
- update the fixture and test counts and the tracklist bundle size (a581eca)
Install
npm install trackparse@0.4.0npm: https://www.npmjs.com/package/trackparse/v/0.4.0 · implements spec 0.4.0 (SPEC.md)