music-metadata 11.1.0 → 11.1.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/lib/core.d.ts CHANGED
@@ -3,10 +3,11 @@
3
3
  */
4
4
  import { type AnyWebByteStream, type IFileInfo, type ITokenizer, type IRandomAccessTokenizer } from 'strtok3';
5
5
  import type { IAudioMetadata, INativeTagDict, IOptions, IPicture, IPrivateOptions, ITag } from './type.js';
6
+ import type { Readable } from 'node:stream';
6
7
  export type { IFileInfo } from 'strtok3';
7
8
  export { type IAudioMetadata, type IOptions, type ITag, type INativeTagDict, type ICommonTagsResult, type IFormat, type IPicture, type IRatio, type IChapter, type ILyricsTag, LyricsContentType, TimestampFormat, IMetadataEventTag, IMetadataEvent } from './type.js';
8
9
  export { CouldNotDetermineFileTypeError, UnsupportedFileTypeError } from './ParseError.js';
9
- export type * from './ParseError.js';
10
+ export * from './ParseError.js';
10
11
  /**
11
12
  * Parse Web API File
12
13
  * Requires Blob to be able to stream using a ReadableStreamBYOBReader, only available since Node.js ≥ 20
@@ -63,6 +64,11 @@ export declare function scanAppendingHeaders(tokenizer: IRandomAccessTokenizer,
63
64
  * This method will throw an Error, always.
64
65
  */
65
66
  export declare function parseFile(filePath: string, options?: IOptions): Promise<IAudioMetadata>;
67
+ /**
68
+ * Implementation only available when loaded as Node.js
69
+ * This method will throw an Error, always.
70
+ */
71
+ export declare function parseStream(stream: Readable, fileInfo?: IFileInfo | string, options?: IOptions): Promise<IAudioMetadata>;
66
72
  /**
67
73
  * Return a list of supported mime-types
68
74
  */
package/lib/core.js CHANGED
@@ -8,6 +8,7 @@ import { hasID3v1Header } from './id3v1/ID3v1Parser.js';
8
8
  import { getLyricsHeaderLength } from './lyrics3/Lyrics3.js';
9
9
  export { LyricsContentType, TimestampFormat } from './type.js';
10
10
  export { CouldNotDetermineFileTypeError, UnsupportedFileTypeError } from './ParseError.js';
11
+ export * from './ParseError.js';
11
12
  /**
12
13
  * Parse Web API File
13
14
  * Requires Blob to be able to stream using a ReadableStreamBYOBReader, only available since Node.js ≥ 20
@@ -109,7 +110,14 @@ export async function scanAppendingHeaders(tokenizer, options = {}) {
109
110
  * This method will throw an Error, always.
110
111
  */
111
112
  export async function parseFile(filePath, options = {}) {
112
- throw new Error('To load Web API File objects use parseBlob instead. For loading files, you need to import with the "node" condition is set.');
113
+ throw new Error('This function require a Node engine. To load Web API File objects use parseBlob instead.');
114
+ }
115
+ /**
116
+ * Implementation only available when loaded as Node.js
117
+ * This method will throw an Error, always.
118
+ */
119
+ export async function parseStream(stream, fileInfo, options = {}) {
120
+ throw new Error('This function require a Node engine.');
113
121
  }
114
122
  /**
115
123
  * Return a list of supported mime-types
package/package.json CHANGED
@@ -1,149 +1,149 @@
1
- {
2
- "name": "music-metadata",
3
- "description": "Music metadata parser for Node.js, supporting virtual any audio and tag format.",
4
- "version": "11.1.0",
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
- "sideEffects": false,
20
- "type": "module",
21
- "exports": {
22
- "node": {
23
- "import": "./lib/index.js",
24
- "module-sync": "./lib/index.js",
25
- "types": "./lib/index.d.ts"
26
- },
27
- "default": {
28
- "import": "./lib/core.js",
29
- "module-sync": "./lib/core.js",
30
- "types": "./lib/core.d.ts"
31
- }
32
- },
33
- "types": "lib/index.d.ts",
34
- "files": [
35
- "lib/**/*.js",
36
- "lib/**/*.d.ts"
37
- ],
38
- "keywords": [
39
- "music",
40
- "metadata",
41
- "meta",
42
- "audio",
43
- "tag",
44
- "tags",
45
- "duration",
46
- "MusicBrainz",
47
- "Discogs",
48
- "Picard",
49
- "ID3",
50
- "ID3v1",
51
- "ID3v2",
52
- "m4a",
53
- "m4b",
54
- "mp3",
55
- "mp4",
56
- "Vorbis",
57
- "ogg",
58
- "flac",
59
- "Matroska",
60
- "WebM",
61
- "EBML",
62
- "asf",
63
- "wma",
64
- "wmv",
65
- "ape",
66
- "MonkeyAudio",
67
- "aiff",
68
- "wav",
69
- "WavPack",
70
- "Opus",
71
- "speex",
72
- "musepack",
73
- "mpc",
74
- "dsd",
75
- "dsf",
76
- "mpc",
77
- "dff",
78
- "dsdiff",
79
- "aac",
80
- "adts",
81
- "length",
82
- "chapter",
83
- "info",
84
- "parse",
85
- "parser",
86
- "bwf",
87
- "slt",
88
- "lyrics"
89
- ],
90
- "scripts": {
91
- "clean": "del-cli 'lib/**/*.js' 'lib/**/*.js.map' 'lib/**/*.d.ts' 'test/**/*.js' 'test/**/*.js.map' 'test/**/*.js' 'test/**/*.js.map' 'doc-gen/**/*.js' 'doc-gen/**/*.js.map'",
92
- "compile-src": "tsc -p lib",
93
- "compile-test": "tsc -p test",
94
- "compile-doc": "tsc -p doc-gen",
95
- "compile": "yarn run compile-src && yarn compile-test && yarn compile-doc",
96
- "lint-ts": "biome check",
97
- "lint-md": "yarn run remark -u remark-preset-lint-consistent .",
98
- "lint": "yarn run lint-ts && yarn run lint-md",
99
- "test": "mocha",
100
- "build": "yarn run clean && yarn compile && yarn run doc-gen",
101
- "test-coverage": "c8 yarn run test",
102
- "send-codacy": "c8 report --reporter=text-lcov | codacy-coverage",
103
- "doc-gen": "yarn node doc-gen/gen.js",
104
- "typecheck": "tsc --project ./lib/tsconfig.json --noEmit && tsc --project ./test/tsconfig.json --noEmit"
105
- },
106
- "dependencies": {
107
- "@tokenizer/token": "^0.3.0",
108
- "content-type": "^1.0.5",
109
- "debug": "^4.4.0",
110
- "file-type": "^19.6.0",
111
- "link": "^2.1.1",
112
- "media-typer": "^1.1.0",
113
- "strtok3": "^10.2.2",
114
- "token-types": "^6.0.0",
115
- "uint8array-extras": "^1.4.0"
116
- },
117
- "devDependencies": {
118
- "@biomejs/biome": "1.9.4",
119
- "@types/chai": "^5.2.1",
120
- "@types/chai-as-promised": "^8.0.2",
121
- "@types/content-type": "^1.1.8",
122
- "@types/debug": "^4.1.12",
123
- "@types/media-typer": "^1.1.3",
124
- "@types/mocha": "^10.0.10",
125
- "@types/node": "^22.14.0",
126
- "c8": "^10.1.3",
127
- "chai": "^5.2.0",
128
- "chai-as-promised": "^8.0.1",
129
- "del-cli": "^6.0.0",
130
- "mime": "^4.0.7",
131
- "mocha": "^11.1.0",
132
- "node-readable-to-web-readable-stream": "^0.4.2",
133
- "remark-cli": "^12.0.1",
134
- "remark-preset-lint-consistent": "^6.0.1",
135
- "ts-node": "^10.9.2",
136
- "typescript": "^5.8.2"
137
- },
138
- "engines": {
139
- "node": ">=18"
140
- },
141
- "repository": {
142
- "type": "github:Borewit/music-metadata"
143
- },
144
- "license": "MIT",
145
- "bugs": {
146
- "url": "https://github.com/Borewit/music-metadata/issues"
147
- },
148
- "packageManager": "yarn@4.8.1"
149
- }
1
+ {
2
+ "name": "music-metadata",
3
+ "description": "Music metadata parser for Node.js, supporting virtual any audio and tag format.",
4
+ "version": "11.1.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
+ "sideEffects": false,
20
+ "type": "module",
21
+ "exports": {
22
+ "node": {
23
+ "import": "./lib/index.js",
24
+ "module-sync": "./lib/index.js",
25
+ "types": "./lib/index.d.ts"
26
+ },
27
+ "default": {
28
+ "import": "./lib/core.js",
29
+ "module-sync": "./lib/core.js",
30
+ "types": "./lib/core.d.ts"
31
+ }
32
+ },
33
+ "types": "lib/index.d.ts",
34
+ "files": [
35
+ "lib/**/*.js",
36
+ "lib/**/*.d.ts"
37
+ ],
38
+ "keywords": [
39
+ "music",
40
+ "metadata",
41
+ "meta",
42
+ "audio",
43
+ "tag",
44
+ "tags",
45
+ "duration",
46
+ "MusicBrainz",
47
+ "Discogs",
48
+ "Picard",
49
+ "ID3",
50
+ "ID3v1",
51
+ "ID3v2",
52
+ "m4a",
53
+ "m4b",
54
+ "mp3",
55
+ "mp4",
56
+ "Vorbis",
57
+ "ogg",
58
+ "flac",
59
+ "Matroska",
60
+ "WebM",
61
+ "EBML",
62
+ "asf",
63
+ "wma",
64
+ "wmv",
65
+ "ape",
66
+ "MonkeyAudio",
67
+ "aiff",
68
+ "wav",
69
+ "WavPack",
70
+ "Opus",
71
+ "speex",
72
+ "musepack",
73
+ "mpc",
74
+ "dsd",
75
+ "dsf",
76
+ "mpc",
77
+ "dff",
78
+ "dsdiff",
79
+ "aac",
80
+ "adts",
81
+ "length",
82
+ "chapter",
83
+ "info",
84
+ "parse",
85
+ "parser",
86
+ "bwf",
87
+ "slt",
88
+ "lyrics"
89
+ ],
90
+ "scripts": {
91
+ "clean": "del-cli 'lib/**/*.js' 'lib/**/*.js.map' 'lib/**/*.d.ts' 'test/**/*.js' 'test/**/*.js.map' 'test/**/*.js' 'test/**/*.js.map' 'doc-gen/**/*.js' 'doc-gen/**/*.js.map'",
92
+ "compile-src": "tsc -p lib",
93
+ "compile-test": "tsc -p test",
94
+ "compile-doc": "tsc -p doc-gen",
95
+ "compile": "yarn run compile-src && yarn compile-test && yarn compile-doc",
96
+ "lint-ts": "biome check",
97
+ "lint-md": "yarn run remark -u remark-preset-lint-consistent .",
98
+ "lint": "yarn run lint-ts && yarn run lint-md",
99
+ "test": "mocha",
100
+ "build": "yarn run clean && yarn compile && yarn run doc-gen",
101
+ "test-coverage": "c8 yarn run test",
102
+ "send-codacy": "c8 report --reporter=text-lcov | codacy-coverage",
103
+ "doc-gen": "yarn node doc-gen/gen.js",
104
+ "typecheck": "tsc --project ./lib/tsconfig.json --noEmit && tsc --project ./test/tsconfig.json --noEmit"
105
+ },
106
+ "dependencies": {
107
+ "@tokenizer/token": "^0.3.0",
108
+ "content-type": "^1.0.5",
109
+ "debug": "^4.4.0",
110
+ "file-type": "^19.6.0",
111
+ "link": "^2.1.1",
112
+ "media-typer": "^1.1.0",
113
+ "strtok3": "^10.2.2",
114
+ "token-types": "^6.0.0",
115
+ "uint8array-extras": "^1.4.0"
116
+ },
117
+ "devDependencies": {
118
+ "@biomejs/biome": "1.9.4",
119
+ "@types/chai": "^5.2.1",
120
+ "@types/chai-as-promised": "^8.0.2",
121
+ "@types/content-type": "^1.1.8",
122
+ "@types/debug": "^4.1.12",
123
+ "@types/media-typer": "^1.1.3",
124
+ "@types/mocha": "^10.0.10",
125
+ "@types/node": "^22.14.0",
126
+ "c8": "^10.1.3",
127
+ "chai": "^5.2.0",
128
+ "chai-as-promised": "^8.0.1",
129
+ "del-cli": "^6.0.0",
130
+ "mime": "^4.0.7",
131
+ "mocha": "^11.1.0",
132
+ "node-readable-to-web-readable-stream": "^0.4.2",
133
+ "remark-cli": "^12.0.1",
134
+ "remark-preset-lint-consistent": "^6.0.1",
135
+ "ts-node": "^10.9.2",
136
+ "typescript": "^5.8.2"
137
+ },
138
+ "engines": {
139
+ "node": ">=18"
140
+ },
141
+ "repository": {
142
+ "type": "github:Borewit/music-metadata"
143
+ },
144
+ "license": "MIT",
145
+ "bugs": {
146
+ "url": "https://github.com/Borewit/music-metadata/issues"
147
+ },
148
+ "packageManager": "yarn@4.8.1"
149
+ }