music-metadata 10.5.1 → 10.6.1
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/LICENSE.txt +9 -9
- package/README.md +850 -845
- package/lib/ParserFactory.js +8 -0
- package/lib/apev2/APEv2Parser.d.ts +4 -3
- package/lib/apev2/APEv2Parser.js +5 -3
- package/lib/asf/AsfObject.d.ts +7 -1
- package/lib/asf/AsfObject.js +0 -1
- package/lib/common/MetadataCollector.js +6 -0
- package/lib/core.d.ts +3 -3
- package/lib/core.js +6 -8
- package/lib/default.cjs +5 -5
- package/lib/dsdiff/DsdiffToken.d.ts +1 -1
- package/lib/id3v1/ID3v1Parser.d.ts +3 -3
- package/lib/id3v1/ID3v1Parser.js +5 -3
- package/lib/id3v2/FrameParser.js +4 -3
- package/lib/index.js +1 -9
- package/lib/lrc/LyricsParser.d.ts +7 -0
- package/lib/lrc/LyricsParser.js +32 -0
- package/lib/lyrics3/Lyrics3.d.ts +2 -2
- package/lib/lyrics3/Lyrics3.js +7 -3
- package/lib/mpeg/MpegParser.js +2 -2
- package/lib/node.cjs +5 -5
- package/lib/riff/RiffChunk.d.ts +1 -1
- package/lib/type.d.ts +1 -20
- package/package.json +150 -148
- package/lib/common/RandomFileReader.d.ts +0 -21
- package/lib/common/RandomFileReader.js +0 -30
- package/lib/common/RandomUint8ArrayReader.d.ts +0 -18
- package/lib/common/RandomUint8ArrayReader.js +0 -21
package/package.json
CHANGED
|
@@ -1,148 +1,150 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "music-metadata",
|
|
3
|
-
"description": "Music metadata parser for Node.js, supporting virtual any audio and tag format.",
|
|
4
|
-
"version": "10.
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "Borewit",
|
|
7
|
-
"url": "https://github.com/Borewit"
|
|
8
|
-
},
|
|
9
|
-
"funding": [
|
|
10
|
-
{
|
|
11
|
-
"type": "github",
|
|
12
|
-
"url": "https://github.com/sponsors/Borewit"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"type": "buymeacoffee",
|
|
16
|
-
"url": "https://buymeacoffee.com/borewit"
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
"type": "module",
|
|
20
|
-
"exports": {
|
|
21
|
-
".": {
|
|
22
|
-
"node": {
|
|
23
|
-
"import": "./lib/index.js",
|
|
24
|
-
"require": "./lib/node.cjs",
|
|
25
|
-
"types": "./lib/index.d.ts"
|
|
26
|
-
},
|
|
27
|
-
"default": {
|
|
28
|
-
"import": "./lib/core.js",
|
|
29
|
-
"require": "./lib/default.cjs",
|
|
30
|
-
"types": "./lib/core.d.ts"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
"types": "lib/index.d.ts",
|
|
35
|
-
"files": [
|
|
36
|
-
"lib/**/*.js",
|
|
37
|
-
"lib/**/*.d.ts",
|
|
38
|
-
"lib/*.cjs"
|
|
39
|
-
],
|
|
40
|
-
"keywords": [
|
|
41
|
-
"music",
|
|
42
|
-
"metadata",
|
|
43
|
-
"meta",
|
|
44
|
-
"audio",
|
|
45
|
-
"tag",
|
|
46
|
-
"tags",
|
|
47
|
-
"duration",
|
|
48
|
-
"MusicBrainz",
|
|
49
|
-
"Discogs",
|
|
50
|
-
"Picard",
|
|
51
|
-
"ID3",
|
|
52
|
-
"ID3v1",
|
|
53
|
-
"ID3v2",
|
|
54
|
-
"m4a",
|
|
55
|
-
"m4b",
|
|
56
|
-
"mp3",
|
|
57
|
-
"mp4",
|
|
58
|
-
"Vorbis",
|
|
59
|
-
"ogg",
|
|
60
|
-
"flac",
|
|
61
|
-
"Matroska",
|
|
62
|
-
"WebM",
|
|
63
|
-
"EBML",
|
|
64
|
-
"asf",
|
|
65
|
-
"wma",
|
|
66
|
-
"wmv",
|
|
67
|
-
"ape",
|
|
68
|
-
"MonkeyAudio",
|
|
69
|
-
"aiff",
|
|
70
|
-
"wav",
|
|
71
|
-
"WavPack",
|
|
72
|
-
"Opus",
|
|
73
|
-
"speex",
|
|
74
|
-
"musepack",
|
|
75
|
-
"mpc",
|
|
76
|
-
"dsd",
|
|
77
|
-
"dsf",
|
|
78
|
-
"mpc",
|
|
79
|
-
"dff",
|
|
80
|
-
"dsdiff",
|
|
81
|
-
"aac",
|
|
82
|
-
"adts",
|
|
83
|
-
"length",
|
|
84
|
-
"chapter",
|
|
85
|
-
"info",
|
|
86
|
-
"parse",
|
|
87
|
-
"parser",
|
|
88
|
-
"bwf"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
"
|
|
94
|
-
"compile-
|
|
95
|
-
"compile": "
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"lint": "
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"test
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
"@
|
|
120
|
-
"@types/
|
|
121
|
-
"@types/
|
|
122
|
-
"@types/
|
|
123
|
-
"@types/
|
|
124
|
-
"
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
"
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "music-metadata",
|
|
3
|
+
"description": "Music metadata parser for Node.js, supporting virtual any audio and tag format.",
|
|
4
|
+
"version": "10.6.1",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Borewit",
|
|
7
|
+
"url": "https://github.com/Borewit"
|
|
8
|
+
},
|
|
9
|
+
"funding": [
|
|
10
|
+
{
|
|
11
|
+
"type": "github",
|
|
12
|
+
"url": "https://github.com/sponsors/Borewit"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"type": "buymeacoffee",
|
|
16
|
+
"url": "https://buymeacoffee.com/borewit"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"node": {
|
|
23
|
+
"import": "./lib/index.js",
|
|
24
|
+
"require": "./lib/node.cjs",
|
|
25
|
+
"types": "./lib/index.d.ts"
|
|
26
|
+
},
|
|
27
|
+
"default": {
|
|
28
|
+
"import": "./lib/core.js",
|
|
29
|
+
"require": "./lib/default.cjs",
|
|
30
|
+
"types": "./lib/core.d.ts"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"types": "lib/index.d.ts",
|
|
35
|
+
"files": [
|
|
36
|
+
"lib/**/*.js",
|
|
37
|
+
"lib/**/*.d.ts",
|
|
38
|
+
"lib/*.cjs"
|
|
39
|
+
],
|
|
40
|
+
"keywords": [
|
|
41
|
+
"music",
|
|
42
|
+
"metadata",
|
|
43
|
+
"meta",
|
|
44
|
+
"audio",
|
|
45
|
+
"tag",
|
|
46
|
+
"tags",
|
|
47
|
+
"duration",
|
|
48
|
+
"MusicBrainz",
|
|
49
|
+
"Discogs",
|
|
50
|
+
"Picard",
|
|
51
|
+
"ID3",
|
|
52
|
+
"ID3v1",
|
|
53
|
+
"ID3v2",
|
|
54
|
+
"m4a",
|
|
55
|
+
"m4b",
|
|
56
|
+
"mp3",
|
|
57
|
+
"mp4",
|
|
58
|
+
"Vorbis",
|
|
59
|
+
"ogg",
|
|
60
|
+
"flac",
|
|
61
|
+
"Matroska",
|
|
62
|
+
"WebM",
|
|
63
|
+
"EBML",
|
|
64
|
+
"asf",
|
|
65
|
+
"wma",
|
|
66
|
+
"wmv",
|
|
67
|
+
"ape",
|
|
68
|
+
"MonkeyAudio",
|
|
69
|
+
"aiff",
|
|
70
|
+
"wav",
|
|
71
|
+
"WavPack",
|
|
72
|
+
"Opus",
|
|
73
|
+
"speex",
|
|
74
|
+
"musepack",
|
|
75
|
+
"mpc",
|
|
76
|
+
"dsd",
|
|
77
|
+
"dsf",
|
|
78
|
+
"mpc",
|
|
79
|
+
"dff",
|
|
80
|
+
"dsdiff",
|
|
81
|
+
"aac",
|
|
82
|
+
"adts",
|
|
83
|
+
"length",
|
|
84
|
+
"chapter",
|
|
85
|
+
"info",
|
|
86
|
+
"parse",
|
|
87
|
+
"parser",
|
|
88
|
+
"bwf",
|
|
89
|
+
"slt",
|
|
90
|
+
"lyrics"
|
|
91
|
+
],
|
|
92
|
+
"scripts": {
|
|
93
|
+
"clean": "del-cli 'lib/**/*.js' 'lib/**/*.js.map' 'lib/**/*.d.ts' 'src/**/*.d.ts' 'test/**/*.js' 'test/**/*.js.map' 'test/**/*.js' 'test/**/*.js.map' 'doc-gen/**/*.js' 'doc-gen/**/*.js.map'",
|
|
94
|
+
"compile-src": "tsc -p lib",
|
|
95
|
+
"compile-test": "tsc -p test",
|
|
96
|
+
"compile-doc": "tsc -p doc-gen",
|
|
97
|
+
"compile": "yarn run compile-src && yarn compile-test && yarn compile-doc",
|
|
98
|
+
"lint-ts": "biome check",
|
|
99
|
+
"lint-md": "yarn run remark -u remark-preset-lint-consistent .",
|
|
100
|
+
"lint": "yarn run lint-ts && yarn run lint-md",
|
|
101
|
+
"test": "mocha",
|
|
102
|
+
"build": "yarn run clean && yarn compile && yarn run doc-gen",
|
|
103
|
+
"test-coverage": "c8 yarn run test",
|
|
104
|
+
"send-codacy": "c8 report --reporter=text-lcov | codacy-coverage",
|
|
105
|
+
"doc-gen": "yarn node doc-gen/gen.js"
|
|
106
|
+
},
|
|
107
|
+
"dependencies": {
|
|
108
|
+
"@tokenizer/token": "^0.3.0",
|
|
109
|
+
"content-type": "^1.0.5",
|
|
110
|
+
"debug": "^4.3.7",
|
|
111
|
+
"file-type": "^19.6.0",
|
|
112
|
+
"link": "^2.1.1",
|
|
113
|
+
"media-typer": "^1.1.0",
|
|
114
|
+
"strtok3": "^9.1.1",
|
|
115
|
+
"token-types": "^6.0.0",
|
|
116
|
+
"uint8array-extras": "^1.4.0"
|
|
117
|
+
},
|
|
118
|
+
"devDependencies": {
|
|
119
|
+
"@biomejs/biome": "1.9.4",
|
|
120
|
+
"@types/chai": "^5.0.1",
|
|
121
|
+
"@types/chai-as-promised": "^8.0.1",
|
|
122
|
+
"@types/content-type": "^1.1.8",
|
|
123
|
+
"@types/debug": "^4.1.12",
|
|
124
|
+
"@types/media-typer": "^1.1.3",
|
|
125
|
+
"@types/mocha": "^10.0.10",
|
|
126
|
+
"@types/node": "^22.10.1",
|
|
127
|
+
"c8": "^10.1.2",
|
|
128
|
+
"chai": "^5.1.2",
|
|
129
|
+
"chai-as-promised": "^8.0.1",
|
|
130
|
+
"del-cli": "^6.0.0",
|
|
131
|
+
"mime": "^4.0.4",
|
|
132
|
+
"mocha": "^10.8.2",
|
|
133
|
+
"remark-cli": "^12.0.1",
|
|
134
|
+
"remark-preset-lint-consistent": "^6.0.0",
|
|
135
|
+
"ts-node": "^10.9.2",
|
|
136
|
+
"typescript": "^5.7.2"
|
|
137
|
+
},
|
|
138
|
+
"engines": {
|
|
139
|
+
"node": ">=16.0.0"
|
|
140
|
+
},
|
|
141
|
+
"repository": {
|
|
142
|
+
"type": "git",
|
|
143
|
+
"url": "git+https://github.com/borewit/music-metadata.git"
|
|
144
|
+
},
|
|
145
|
+
"license": "MIT",
|
|
146
|
+
"bugs": {
|
|
147
|
+
"url": "https://github.com/Borewit/music-metadata/issues"
|
|
148
|
+
},
|
|
149
|
+
"packageManager": "yarn@4.3.1"
|
|
150
|
+
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { IRandomReader } from '../type.js';
|
|
2
|
-
/**
|
|
3
|
-
* Provides abstract file access via the IRandomRead interface
|
|
4
|
-
*/
|
|
5
|
-
export declare class RandomFileReader implements IRandomReader {
|
|
6
|
-
private readonly fileHandle;
|
|
7
|
-
filePath: string;
|
|
8
|
-
fileSize: number;
|
|
9
|
-
private constructor();
|
|
10
|
-
/**
|
|
11
|
-
* Read from a given position of an abstracted file or buffer.
|
|
12
|
-
* @param buffer {Uint8Array} is the buffer that the data will be written to.
|
|
13
|
-
* @param offset {number} is the offset in the buffer to start writing at.
|
|
14
|
-
* @param length {number}is an integer specifying the number of bytes to read.
|
|
15
|
-
* @param position {number} is an argument specifying where to begin reading from in the file.
|
|
16
|
-
* @return {Promise<number>} bytes read
|
|
17
|
-
*/
|
|
18
|
-
randomRead(buffer: Uint8Array, offset: number, length: number, position: number): Promise<number>;
|
|
19
|
-
close(): Promise<void>;
|
|
20
|
-
static init(filePath: string, fileSize: number): Promise<RandomFileReader>;
|
|
21
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as fs from 'node:fs';
|
|
2
|
-
/**
|
|
3
|
-
* Provides abstract file access via the IRandomRead interface
|
|
4
|
-
*/
|
|
5
|
-
export class RandomFileReader {
|
|
6
|
-
constructor(fileHandle, filePath, fileSize) {
|
|
7
|
-
this.fileHandle = fileHandle;
|
|
8
|
-
this.filePath = filePath;
|
|
9
|
-
this.fileSize = fileSize;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Read from a given position of an abstracted file or buffer.
|
|
13
|
-
* @param buffer {Uint8Array} is the buffer that the data will be written to.
|
|
14
|
-
* @param offset {number} is the offset in the buffer to start writing at.
|
|
15
|
-
* @param length {number}is an integer specifying the number of bytes to read.
|
|
16
|
-
* @param position {number} is an argument specifying where to begin reading from in the file.
|
|
17
|
-
* @return {Promise<number>} bytes read
|
|
18
|
-
*/
|
|
19
|
-
async randomRead(buffer, offset, length, position) {
|
|
20
|
-
const result = await this.fileHandle.read(buffer, offset, length, position);
|
|
21
|
-
return result.bytesRead;
|
|
22
|
-
}
|
|
23
|
-
async close() {
|
|
24
|
-
return this.fileHandle.close();
|
|
25
|
-
}
|
|
26
|
-
static async init(filePath, fileSize) {
|
|
27
|
-
const fileHandle = await fs.promises.open(filePath, 'r');
|
|
28
|
-
return new RandomFileReader(fileHandle, filePath, fileSize);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { IRandomReader } from '../type.js';
|
|
2
|
-
/**
|
|
3
|
-
* Provides abstract Uint8Array access via the IRandomRead interface
|
|
4
|
-
*/
|
|
5
|
-
export declare class RandomUint8ArrayReader implements IRandomReader {
|
|
6
|
-
private readonly uint8Array;
|
|
7
|
-
readonly fileSize: number;
|
|
8
|
-
constructor(uint8Array: Uint8Array);
|
|
9
|
-
/**
|
|
10
|
-
* Read from a given position of an abstracted file or buffer.
|
|
11
|
-
* @param uint8Array - Uint8Array that the data will be written to.
|
|
12
|
-
* @param offset - Offset in the buffer to start writing at.
|
|
13
|
-
* @param length - Integer specifying the number of bytes to read.
|
|
14
|
-
* @param position - Specifies where to begin reading from in the file.
|
|
15
|
-
* @return Promise providing bytes read
|
|
16
|
-
*/
|
|
17
|
-
randomRead(uint8Array: Uint8Array, offset: number, length: number, position: number): Promise<number>;
|
|
18
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provides abstract Uint8Array access via the IRandomRead interface
|
|
3
|
-
*/
|
|
4
|
-
export class RandomUint8ArrayReader {
|
|
5
|
-
constructor(uint8Array) {
|
|
6
|
-
this.uint8Array = uint8Array;
|
|
7
|
-
this.fileSize = uint8Array.length;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Read from a given position of an abstracted file or buffer.
|
|
11
|
-
* @param uint8Array - Uint8Array that the data will be written to.
|
|
12
|
-
* @param offset - Offset in the buffer to start writing at.
|
|
13
|
-
* @param length - Integer specifying the number of bytes to read.
|
|
14
|
-
* @param position - Specifies where to begin reading from in the file.
|
|
15
|
-
* @return Promise providing bytes read
|
|
16
|
-
*/
|
|
17
|
-
async randomRead(uint8Array, offset, length, position) {
|
|
18
|
-
uint8Array.set(this.uint8Array.subarray(position, position + length), offset);
|
|
19
|
-
return length;
|
|
20
|
-
}
|
|
21
|
-
}
|