taglib-wasm 0.3.26 → 0.4.0
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
CHANGED
|
@@ -86,7 +86,8 @@ const { TagLib } = require("taglib-wasm");
|
|
|
86
86
|
|
|
87
87
|
### Deno Compiled Binaries (Offline Support)
|
|
88
88
|
|
|
89
|
-
For Deno compiled binaries that need to work offline, you can embed the WASM
|
|
89
|
+
For Deno compiled binaries that need to work offline, you can embed the WASM
|
|
90
|
+
file:
|
|
90
91
|
|
|
91
92
|
```typescript
|
|
92
93
|
// 1. Prepare your build by copying the WASM file
|
|
@@ -105,7 +106,9 @@ For manual control:
|
|
|
105
106
|
|
|
106
107
|
```typescript
|
|
107
108
|
// Load embedded WASM in compiled binaries
|
|
108
|
-
const wasmBinary = await Deno.readFile(
|
|
109
|
+
const wasmBinary = await Deno.readFile(
|
|
110
|
+
new URL("./taglib.wasm", import.meta.url),
|
|
111
|
+
);
|
|
109
112
|
const taglib = await TagLib.initialize({ wasmBinary });
|
|
110
113
|
```
|
|
111
114
|
|
|
@@ -134,10 +137,10 @@ await updateTags("song.mp3", {
|
|
|
134
137
|
});
|
|
135
138
|
```
|
|
136
139
|
|
|
137
|
-
###
|
|
140
|
+
### Full API
|
|
138
141
|
|
|
139
|
-
The
|
|
140
|
-
|
|
142
|
+
The Full API might be a better choice for apps and utilities focused on advanced
|
|
143
|
+
metadata management.
|
|
141
144
|
|
|
142
145
|
```typescript
|
|
143
146
|
import { TagLib } from "taglib-wasm";
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```typescript
|
|
11
|
-
* // Using the
|
|
11
|
+
* // Using the Full API
|
|
12
12
|
* import { TagLib } from "taglib-wasm";
|
|
13
13
|
*
|
|
14
14
|
* const taglib = await TagLib.initialize();
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Full API exports for advanced usage with full control.
|
|
37
37
|
* @see {@link TagLib} - Main TagLib class
|
|
38
38
|
* @see {@link AudioFile} - Audio file interface
|
|
39
39
|
* @see {@link createTagLib} - Factory function for creating TagLib instances
|
|
@@ -125,7 +125,7 @@ export interface LoadTagLibOptions {
|
|
|
125
125
|
/**
|
|
126
126
|
* Load the TagLib Wasm module.
|
|
127
127
|
* This function initializes the WebAssembly module and returns
|
|
128
|
-
* the loaded module for use with the
|
|
128
|
+
* the loaded module for use with the Full API.
|
|
129
129
|
*
|
|
130
130
|
* @param config - Optional configuration for module initialization
|
|
131
131
|
* @returns Promise resolving to the initialized TagLib module
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deno-compile-support.d.ts","sourceRoot":"","sources":["../../src/deno-compile-support.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAIxC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CACnC,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"deno-compile-support.d.ts","sourceRoot":"","sources":["../../src/deno-compile-support.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;GAEG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAIxC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CACnC,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CA2CjC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,sCAcvE"}
|
|
@@ -29,7 +29,9 @@ async function loadWasmForDeno(options = {}) {
|
|
|
29
29
|
];
|
|
30
30
|
for (const strategy of strategies) {
|
|
31
31
|
const result = await strategy();
|
|
32
|
-
if (result)
|
|
32
|
+
if (result) {
|
|
33
|
+
return result instanceof Uint8Array ? result : new Uint8Array(result);
|
|
34
|
+
}
|
|
33
35
|
}
|
|
34
36
|
return void 0;
|
|
35
37
|
}
|
package/dist/src/simple.js
CHANGED
|
@@ -8,8 +8,8 @@ import { writeFileData } from "./utils/write.js";
|
|
|
8
8
|
let cachedTagLib = null;
|
|
9
9
|
async function getTagLib() {
|
|
10
10
|
if (!cachedTagLib) {
|
|
11
|
-
const { TagLib
|
|
12
|
-
cachedTagLib = await
|
|
11
|
+
const { TagLib } = await import("./taglib.js");
|
|
12
|
+
cachedTagLib = await TagLib.initialize();
|
|
13
13
|
}
|
|
14
14
|
return cachedTagLib;
|
|
15
15
|
}
|
package/dist/src/workers.d.ts
CHANGED
|
@@ -100,7 +100,7 @@ export declare class AudioFileWorkers {
|
|
|
100
100
|
* Get the current file buffer after modifications.
|
|
101
101
|
* Note: This is not implemented in the Workers API.
|
|
102
102
|
* @returns Empty Uint8Array (not implemented)
|
|
103
|
-
* @deprecated Use the
|
|
103
|
+
* @deprecated Use the Full API for this functionality
|
|
104
104
|
*/
|
|
105
105
|
getFileBuffer(): Uint8Array;
|
|
106
106
|
/**
|
package/dist/src/workers.js
CHANGED
|
@@ -159,11 +159,11 @@ class AudioFileWorkers {
|
|
|
159
159
|
* Get the current file buffer after modifications.
|
|
160
160
|
* Note: This is not implemented in the Workers API.
|
|
161
161
|
* @returns Empty Uint8Array (not implemented)
|
|
162
|
-
* @deprecated Use the
|
|
162
|
+
* @deprecated Use the Full API for this functionality
|
|
163
163
|
*/
|
|
164
164
|
getFileBuffer() {
|
|
165
165
|
console.warn(
|
|
166
|
-
"getFileBuffer() is not implemented in Workers API. Use
|
|
166
|
+
"getFileBuffer() is not implemented in Workers API. Use Full API for this functionality."
|
|
167
167
|
);
|
|
168
168
|
return new Uint8Array(0);
|
|
169
169
|
}
|
|
@@ -280,7 +280,7 @@ class TagLibWorkers {
|
|
|
280
280
|
if (!this.module._taglib_file_new_from_buffer) {
|
|
281
281
|
throw new EnvironmentError(
|
|
282
282
|
"Workers",
|
|
283
|
-
"requires C-style functions which are not available. Use the
|
|
283
|
+
"requires C-style functions which are not available. Use the Full API instead for this environment",
|
|
284
284
|
"C-style function exports"
|
|
285
285
|
);
|
|
286
286
|
}
|
package/package.json
CHANGED