trackparse 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -0
- package/dist/{chunk-L4WNGZ5H.js → chunk-TOZBVIQ2.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/tracklist.cjs +1 -1
- package/dist/tracklist.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,6 +29,8 @@ Node 18 or later. No Node-specific APIs are used, so it also runs in browsers an
|
|
|
29
29
|
|
|
30
30
|
## Quick start
|
|
31
31
|
|
|
32
|
+
**Docs:** [Getting started](https://4matic.github.io/trackparse/start/getting-started/)
|
|
33
|
+
|
|
32
34
|
```js
|
|
33
35
|
import { parse } from "trackparse";
|
|
34
36
|
// const { parse } = require("trackparse");
|
|
@@ -51,12 +53,16 @@ track.mode; // 'youtube' (auto-detected from the junk gro
|
|
|
51
53
|
|
|
52
54
|
## API
|
|
53
55
|
|
|
56
|
+
**Docs:** [parse and ParsedTrack](https://4matic.github.io/trackparse/reference/parse/) · [Other functions](https://4matic.github.io/trackparse/reference/functions/)
|
|
57
|
+
|
|
54
58
|
### `parse(input, options?) → ParsedTrack`
|
|
55
59
|
|
|
56
60
|
Parses one track string. Every key of the result is always present.
|
|
57
61
|
|
|
58
62
|
### `parseArtists(input, options?) → Artist[]`
|
|
59
63
|
|
|
64
|
+
**Docs:** [parseArtists](https://4matic.github.io/trackparse/reference/functions/#parseartistsinput-options)
|
|
65
|
+
|
|
60
66
|
Splits an artist string (no title) into credits.
|
|
61
67
|
|
|
62
68
|
```js
|
|
@@ -71,6 +77,8 @@ parseArtists("Sub Focus, Wilkinson & Dimension feat. Kojo");
|
|
|
71
77
|
|
|
72
78
|
### `format(track, options?) → string`
|
|
73
79
|
|
|
80
|
+
**Docs:** [format](https://4matic.github.io/trackparse/reference/functions/#formattrack-options) · [Formatting](https://4matic.github.io/trackparse/guides/formatting/)
|
|
81
|
+
|
|
74
82
|
Renders a `ParsedTrack` back to `Artists - Title (versions) (prod. ...)`.
|
|
75
83
|
|
|
76
84
|
```js
|
|
@@ -92,6 +100,8 @@ format(t, { feat: "omit", versions: "none" }); // 'Wilkinson - Afterglow'
|
|
|
92
100
|
|
|
93
101
|
### `normalize(input) → string`
|
|
94
102
|
|
|
103
|
+
**Docs:** [normalize](https://4matic.github.io/trackparse/reference/functions/#normalizeinput)
|
|
104
|
+
|
|
95
105
|
The Unicode cleanup applied before parsing: NFC, zero-width spaces, BOM and soft hyphens removed, fullwidth
|
|
96
106
|
brackets, smart quotes and dash variants mapped to ASCII, whitespace collapsed. Idempotent.
|
|
97
107
|
|
|
@@ -102,6 +112,8 @@ normalize(" Artist — Title (Remix) “Quoted” ");
|
|
|
102
112
|
|
|
103
113
|
### `allArtists(track) → Artist[]`
|
|
104
114
|
|
|
115
|
+
**Docs:** [allArtists](https://4matic.github.io/trackparse/reference/functions/#allartiststrack)
|
|
116
|
+
|
|
105
117
|
Track credits plus every version's remixers, deduplicated.
|
|
106
118
|
|
|
107
119
|
```js
|
|
@@ -112,6 +124,8 @@ allArtists(parse("Camo & Krooked - Kallisto (Noisia Remix)", { knownArtists: ["C
|
|
|
112
124
|
|
|
113
125
|
### `createParser(options) → { parse, parseArtists }`
|
|
114
126
|
|
|
127
|
+
**Docs:** [createParser](https://4matic.github.io/trackparse/reference/functions/#createparseroptions)
|
|
128
|
+
|
|
115
129
|
Compiles options, including extra vocabulary, once. Per-call options are merged over the base.
|
|
116
130
|
|
|
117
131
|
```js
|
|
@@ -133,6 +147,8 @@ The spec version this build implements, e.g. `"0.3.0"`. Always equal to the pack
|
|
|
133
147
|
|
|
134
148
|
## Options
|
|
135
149
|
|
|
150
|
+
**Docs:** [Options](https://4matic.github.io/trackparse/reference/options/)
|
|
151
|
+
|
|
136
152
|
| Option | Default | Effect |
|
|
137
153
|
|---|---|---|
|
|
138
154
|
| `mode` | `"auto"` | `"clean"` (tags, store metadata), `"youtube"` (video titles), `"filename"`, `"tracklist"` (one line of a tracklist), or `"auto"` to detect. |
|
|
@@ -207,6 +223,8 @@ The full field reference, a gallery of examples and the comparison with other li
|
|
|
207
223
|
|
|
208
224
|
## Tracklists
|
|
209
225
|
|
|
226
|
+
**Docs:** [Tracklists](https://4matic.github.io/trackparse/guides/tracklists/) · [Editing tracklists](https://4matic.github.io/trackparse/guides/editing-tracklists/)
|
|
227
|
+
|
|
210
228
|
`trackparse/tracklist` parses a whole tracklist: one entry per line with its kind, start time and
|
|
211
229
|
a full `ParsedTrack`, plus checks with line numbers. Joining `raw + eol` over the entries gives the
|
|
212
230
|
input back byte for byte, whatever the line endings. It's a separate entry point (about 7.6 KiB
|
|
@@ -288,6 +306,8 @@ Field tables and the full list of rules: the [tracklists guide](https://4matic.g
|
|
|
288
306
|
|
|
289
307
|
## Limitations
|
|
290
308
|
|
|
309
|
+
**Docs:** [Limitations and roadmap](https://4matic.github.io/trackparse/project/roadmap/)
|
|
310
|
+
|
|
291
311
|
One track string per `parse()` call; tracklists go through `trackparse/tracklist`, which reads
|
|
292
312
|
start times only (no durations, trailing times or ranges). No label/catalog, key or BPM fields, and
|
|
293
313
|
no built-in artist database: pass `knownArtists` for names that contain a joiner.
|
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { P as ParsedTrack, A as Artist, F as FormatOptions, a as ParseOptions } from './types-DqJSn18b.cjs';
|
|
2
2
|
export { b as ArtistRole, c as ArtistSource, d as Flags, J as Junk, e as JunkKind, K as KeywordOptions, M as Mode, f as ModeOption, g as Position, T as Timestamp, V as Version, h as VersionDelimiter, i as VersionType, W as Warning } from './types-DqJSn18b.cjs';
|
|
3
3
|
|
|
4
|
-
declare const SPEC_VERSION = "0.3.
|
|
4
|
+
declare const SPEC_VERSION = "0.3.3";
|
|
5
5
|
|
|
6
6
|
declare function format(track: ParsedTrack, options?: FormatOptions): string;
|
|
7
7
|
/** All credited names: track artists plus every version's remixers, deduped by R0.4 key. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { P as ParsedTrack, A as Artist, F as FormatOptions, a as ParseOptions } from './types-DqJSn18b.js';
|
|
2
2
|
export { b as ArtistRole, c as ArtistSource, d as Flags, J as Junk, e as JunkKind, K as KeywordOptions, M as Mode, f as ModeOption, g as Position, T as Timestamp, V as Version, h as VersionDelimiter, i as VersionType, W as Warning } from './types-DqJSn18b.js';
|
|
3
3
|
|
|
4
|
-
declare const SPEC_VERSION = "0.3.
|
|
4
|
+
declare const SPEC_VERSION = "0.3.3";
|
|
5
5
|
|
|
6
6
|
declare function format(track: ParsedTrack, options?: FormatOptions): string;
|
|
7
7
|
/** All credited names: track artists plus every version's remixers, deduped by R0.4 key. */
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getDefaultTables, renderVersion, dedupKey, wordMatches } from './chunk-
|
|
2
|
-
export { SPEC_VERSION, createParser, normalize, parse, parseArtists } from './chunk-
|
|
1
|
+
import { getDefaultTables, renderVersion, dedupKey, wordMatches } from './chunk-TOZBVIQ2.js';
|
|
2
|
+
export { SPEC_VERSION, createParser, normalize, parse, parseArtists } from './chunk-TOZBVIQ2.js';
|
|
3
3
|
|
|
4
4
|
// src/format.ts
|
|
5
5
|
function resolve(o) {
|
package/dist/tracklist.cjs
CHANGED
package/dist/tracklist.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { headerWordsData, createListParser, SPEC_VERSION, stringList, PhraseTable, markerWordsData, digitRun, isWhitespace, asciiLower, splitWords, inVocab, isDigit } from './chunk-
|
|
1
|
+
import { headerWordsData, createListParser, SPEC_VERSION, stringList, PhraseTable, markerWordsData, digitRun, isWhitespace, asciiLower, splitWords, inVocab, isDigit } from './chunk-TOZBVIQ2.js';
|
|
2
2
|
|
|
3
3
|
// src/tracklist/split.ts
|
|
4
4
|
function splitLines(text) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trackparse",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Spec-driven parser for music track strings: artists, feat credits, remixes/versions, junk and more from single track strings (store titles, YouTube titles, filenames) and multi-line tracklists.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Maksim Maksimov",
|