taglib-wasm 1.0.0-beta.9 → 1.0.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.
Files changed (268) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +49 -69
  3. package/dist/folder.d.ts +19 -0
  4. package/dist/folder.d.ts.map +1 -0
  5. package/dist/folder.js +2 -0
  6. package/dist/index.d.ts +25 -24
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +11 -56
  9. package/dist/rating.d.ts +15 -0
  10. package/dist/rating.d.ts.map +1 -0
  11. package/dist/rating.js +2 -0
  12. package/dist/simple.d.ts +22 -0
  13. package/dist/simple.d.ts.map +1 -0
  14. package/dist/simple.js +2 -0
  15. package/dist/src/constants/basic-properties.d.ts +7 -7
  16. package/dist/src/constants/basic-properties.d.ts.map +1 -1
  17. package/dist/src/constants/basic-properties.js +7 -8
  18. package/dist/src/constants/complex-properties.d.ts +28 -1
  19. package/dist/src/constants/complex-properties.d.ts.map +1 -1
  20. package/dist/src/constants/complex-properties.js +11 -1
  21. package/dist/src/constants/general-extended-properties.d.ts +61 -22
  22. package/dist/src/constants/general-extended-properties.d.ts.map +1 -1
  23. package/dist/src/constants/general-extended-properties.js +55 -23
  24. package/dist/src/constants/index.d.ts +5 -5
  25. package/dist/src/constants/index.d.ts.map +1 -1
  26. package/dist/src/constants/index.js +1 -1
  27. package/dist/src/constants/properties.d.ts +89 -54
  28. package/dist/src/constants/properties.d.ts.map +1 -1
  29. package/dist/src/constants/properties.js +27 -1
  30. package/dist/src/constants/specialized-properties.d.ts +11 -11
  31. package/dist/src/constants/specialized-properties.js +11 -11
  32. package/dist/src/constants/tags.d.ts +82 -0
  33. package/dist/src/constants/tags.d.ts.map +1 -0
  34. package/dist/src/constants/tags.js +86 -0
  35. package/dist/src/constants/utilities.d.ts +2 -2
  36. package/dist/src/constants.d.ts +1 -1
  37. package/dist/src/deno-compile.d.ts +3 -3
  38. package/dist/src/deno-compile.d.ts.map +1 -1
  39. package/dist/src/deno-compile.js +7 -3
  40. package/dist/src/errors/base.d.ts +3 -3
  41. package/dist/src/errors/base.d.ts.map +1 -1
  42. package/dist/src/errors/classes.d.ts +2 -23
  43. package/dist/src/errors/classes.d.ts.map +1 -1
  44. package/dist/src/errors/classes.js +4 -26
  45. package/dist/src/errors/guards.d.ts +2 -4
  46. package/dist/src/errors/guards.d.ts.map +1 -1
  47. package/dist/src/errors/guards.js +2 -12
  48. package/dist/src/errors/index.d.ts +4 -4
  49. package/dist/src/errors/index.d.ts.map +1 -1
  50. package/dist/src/errors/index.js +5 -11
  51. package/dist/src/errors.d.ts +1 -1
  52. package/dist/src/file-utils/copy-and-find.d.ts.map +1 -1
  53. package/dist/src/file-utils/copy-and-find.js +1 -2
  54. package/dist/src/file-utils/export-operations.d.ts +2 -2
  55. package/dist/src/file-utils/export-operations.d.ts.map +1 -1
  56. package/dist/src/file-utils/export-operations.js +3 -5
  57. package/dist/src/file-utils/import-operations.d.ts +3 -3
  58. package/dist/src/file-utils/import-operations.d.ts.map +1 -1
  59. package/dist/src/file-utils/import-operations.js +4 -4
  60. package/dist/src/file-utils/index.d.ts +4 -4
  61. package/dist/src/file-utils/mime-detection.d.ts +1 -2
  62. package/dist/src/file-utils/mime-detection.d.ts.map +1 -1
  63. package/dist/src/file-utils/mime-detection.js +23 -22
  64. package/dist/src/folder-api/directory-walker.d.ts +1 -1
  65. package/dist/src/folder-api/directory-walker.d.ts.map +1 -1
  66. package/dist/src/folder-api/directory-walker.js +4 -43
  67. package/dist/src/folder-api/file-processors.d.ts +3 -7
  68. package/dist/src/folder-api/file-processors.d.ts.map +1 -1
  69. package/dist/src/folder-api/file-processors.js +12 -51
  70. package/dist/src/folder-api/folder-operations.d.ts +6 -12
  71. package/dist/src/folder-api/folder-operations.d.ts.map +1 -1
  72. package/dist/src/folder-api/folder-operations.js +48 -42
  73. package/dist/src/folder-api/index.d.ts +4 -4
  74. package/dist/src/folder-api/index.d.ts.map +1 -1
  75. package/dist/src/folder-api/scan-operations.d.ts +5 -5
  76. package/dist/src/folder-api/scan-operations.d.ts.map +1 -1
  77. package/dist/src/folder-api/scan-operations.js +17 -77
  78. package/dist/src/folder-api/types.d.ts +44 -39
  79. package/dist/src/folder-api/types.d.ts.map +1 -1
  80. package/dist/src/folder-api/types.js +5 -5
  81. package/dist/src/msgpack/decoder.d.ts +3 -3
  82. package/dist/src/msgpack/decoder.d.ts.map +1 -1
  83. package/dist/src/msgpack/decoder.js +54 -17
  84. package/dist/src/msgpack/encoder.d.ts +1 -1
  85. package/dist/src/msgpack/encoder.d.ts.map +1 -1
  86. package/dist/src/msgpack/encoder.js +38 -13
  87. package/dist/src/msgpack/index.d.ts +8 -8
  88. package/dist/src/msgpack/processor.d.ts +1 -1
  89. package/dist/src/msgpack/utils.d.ts +5 -5
  90. package/dist/src/msgpack/utils.d.ts.map +1 -1
  91. package/dist/src/msgpack/utils.js +9 -3
  92. package/dist/src/runtime/detector.d.ts +11 -0
  93. package/dist/src/runtime/detector.d.ts.map +1 -1
  94. package/dist/src/runtime/detector.js +54 -14
  95. package/dist/src/runtime/loader-types.d.ts +6 -6
  96. package/dist/src/runtime/loader-types.d.ts.map +1 -1
  97. package/dist/src/runtime/module-loader.d.ts +4 -4
  98. package/dist/src/runtime/module-loader.d.ts.map +1 -1
  99. package/dist/src/runtime/module-loader.js +16 -5
  100. package/dist/src/runtime/platform-io.d.ts +19 -0
  101. package/dist/src/runtime/platform-io.d.ts.map +1 -0
  102. package/dist/src/runtime/platform-io.js +188 -0
  103. package/dist/src/runtime/unified-loader/index.d.ts +4 -4
  104. package/dist/src/runtime/unified-loader/loader.d.ts +1 -1
  105. package/dist/src/runtime/unified-loader/module-loading.d.ts +3 -3
  106. package/dist/src/runtime/unified-loader/module-loading.d.ts.map +1 -1
  107. package/dist/src/runtime/unified-loader/module-loading.js +21 -6
  108. package/dist/src/runtime/unified-loader/module-selection.d.ts +2 -2
  109. package/dist/src/runtime/unified-loader/types.d.ts +6 -7
  110. package/dist/src/runtime/unified-loader/types.d.ts.map +1 -1
  111. package/dist/src/runtime/unified-loader/types.js +9 -11
  112. package/dist/src/runtime/wasi-adapter/adapter.d.ts +4 -4
  113. package/dist/src/runtime/wasi-adapter/file-handle.d.ts +7 -7
  114. package/dist/src/runtime/wasi-adapter/file-handle.d.ts.map +1 -1
  115. package/dist/src/runtime/wasi-adapter/file-handle.js +121 -31
  116. package/dist/src/runtime/wasi-adapter/index.d.ts +1 -1
  117. package/dist/src/runtime/wasi-adapter/wasm-io.d.ts +2 -2
  118. package/dist/src/runtime/wasi-fs-deno.d.ts +1 -1
  119. package/dist/src/runtime/wasi-fs-node.d.ts +1 -1
  120. package/dist/src/runtime/wasi-host-loader.d.ts +5 -6
  121. package/dist/src/runtime/wasi-host-loader.d.ts.map +1 -1
  122. package/dist/src/runtime/wasi-host-loader.js +7 -7
  123. package/dist/src/runtime/wasi-host.d.ts +1 -1
  124. package/dist/src/runtime/wasi-host.d.ts.map +1 -1
  125. package/dist/src/runtime/wasi-host.js +2 -1
  126. package/dist/src/runtime/wasi-memory.d.ts +2 -1
  127. package/dist/src/runtime/wasi-memory.d.ts.map +1 -1
  128. package/dist/src/runtime/wasi-memory.js +5 -2
  129. package/dist/src/runtime/wasmer-sdk-loader/high-level-api.d.ts +1 -1
  130. package/dist/src/runtime/wasmer-sdk-loader/index.d.ts +5 -5
  131. package/dist/src/runtime/wasmer-sdk-loader/initialization.d.ts.map +1 -1
  132. package/dist/src/runtime/wasmer-sdk-loader/initialization.js +5 -2
  133. package/dist/src/runtime/wasmer-sdk-loader/loader.d.ts +1 -1
  134. package/dist/src/runtime/wasmer-sdk-loader/loader.d.ts.map +1 -1
  135. package/dist/src/runtime/wasmer-sdk-loader/loader.js +4 -2
  136. package/dist/src/runtime/wasmer-sdk-loader/module-creation.d.ts +1 -1
  137. package/dist/src/runtime/wasmer-sdk-loader/types.d.ts +4 -6
  138. package/dist/src/runtime/wasmer-sdk-loader/types.d.ts.map +1 -1
  139. package/dist/src/runtime/wasmer-sdk-loader/types.js +13 -12
  140. package/dist/src/simple/batch-operations.d.ts +57 -25
  141. package/dist/src/simple/batch-operations.d.ts.map +1 -1
  142. package/dist/src/simple/batch-operations.js +56 -17
  143. package/dist/src/simple/config.d.ts +1 -9
  144. package/dist/src/simple/config.d.ts.map +1 -1
  145. package/dist/src/simple/config.js +2 -42
  146. package/dist/src/simple/index.d.ts +7 -8
  147. package/dist/src/simple/index.d.ts.map +1 -1
  148. package/dist/src/simple/index.js +7 -40
  149. package/dist/src/simple/picture-operations.d.ts +92 -11
  150. package/dist/src/simple/picture-operations.d.ts.map +1 -1
  151. package/dist/src/simple/picture-operations.js +5 -17
  152. package/dist/src/simple/tag-operations.d.ts +68 -12
  153. package/dist/src/simple/tag-operations.d.ts.map +1 -1
  154. package/dist/src/simple/tag-operations.js +34 -63
  155. package/dist/src/taglib/audio-file-base.d.ts +6 -4
  156. package/dist/src/taglib/audio-file-base.d.ts.map +1 -1
  157. package/dist/src/taglib/audio-file-base.js +37 -21
  158. package/dist/src/taglib/audio-file-impl.d.ts +6 -6
  159. package/dist/src/taglib/audio-file-impl.d.ts.map +1 -1
  160. package/dist/src/taglib/audio-file-impl.js +11 -15
  161. package/dist/src/taglib/audio-file-interface.d.ts +21 -46
  162. package/dist/src/taglib/audio-file-interface.d.ts.map +1 -1
  163. package/dist/src/taglib/index.d.ts +6 -6
  164. package/dist/src/taglib/load-audio-data.d.ts.map +1 -1
  165. package/dist/src/taglib/mutable-tag.d.ts +27 -9
  166. package/dist/src/taglib/mutable-tag.d.ts.map +1 -1
  167. package/dist/src/taglib/taglib-class.d.ts +48 -33
  168. package/dist/src/taglib/taglib-class.d.ts.map +1 -1
  169. package/dist/src/taglib/taglib-class.js +36 -71
  170. package/dist/src/taglib.d.ts +1 -1
  171. package/dist/src/types/audio-formats.d.ts +18 -16
  172. package/dist/src/types/audio-formats.d.ts.map +1 -1
  173. package/dist/src/types/config.d.ts +0 -28
  174. package/dist/src/types/config.d.ts.map +1 -1
  175. package/dist/src/types/format-property-keys.d.ts +16 -0
  176. package/dist/src/types/format-property-keys.d.ts.map +1 -0
  177. package/dist/src/types/index.d.ts +7 -6
  178. package/dist/src/types/index.d.ts.map +1 -1
  179. package/dist/src/types/index.js +1 -0
  180. package/dist/src/types/metadata-mappings.d.ts +2 -2
  181. package/dist/src/types/metadata-mappings.d.ts.map +1 -1
  182. package/dist/src/types/metadata-mappings.js +25 -0
  183. package/dist/src/types/pictures.d.ts +4 -4
  184. package/dist/src/types/pictures.d.ts.map +1 -1
  185. package/dist/src/types/tags.d.ts +119 -39
  186. package/dist/src/types/tags.d.ts.map +1 -1
  187. package/dist/src/types.d.ts +1 -1
  188. package/dist/src/utils/file.d.ts.map +1 -1
  189. package/dist/src/utils/file.js +17 -123
  190. package/dist/src/utils/path.d.ts +14 -0
  191. package/dist/src/utils/path.d.ts.map +1 -0
  192. package/dist/src/utils/path.js +17 -0
  193. package/dist/src/utils/rating.d.ts +33 -19
  194. package/dist/src/utils/rating.d.ts.map +1 -1
  195. package/dist/src/utils/rating.js +27 -17
  196. package/dist/src/utils/tag-mapping.d.ts +6 -0
  197. package/dist/src/utils/tag-mapping.d.ts.map +1 -0
  198. package/dist/src/utils/tag-mapping.js +101 -0
  199. package/dist/src/utils/write.d.ts +0 -9
  200. package/dist/src/utils/write.d.ts.map +1 -1
  201. package/dist/src/utils/write.js +3 -28
  202. package/dist/src/wasm.d.ts +11 -5
  203. package/dist/src/wasm.d.ts.map +1 -1
  204. package/dist/src/web-utils/canvas.d.ts +2 -2
  205. package/dist/src/web-utils/canvas.d.ts.map +1 -1
  206. package/dist/src/web-utils/canvas.js +9 -11
  207. package/dist/src/web-utils/data-url.d.ts +3 -3
  208. package/dist/src/web-utils/data-url.d.ts.map +1 -1
  209. package/dist/src/web-utils/data-url.js +7 -4
  210. package/dist/src/web-utils/dom-integration.d.ts +2 -2
  211. package/dist/src/web-utils/index.d.ts +5 -5
  212. package/dist/taglib-web.wasm +0 -0
  213. package/dist/taglib-wrapper.js +1 -1
  214. package/dist/web.d.ts +18 -0
  215. package/dist/web.d.ts.map +1 -0
  216. package/dist/web.js +2 -0
  217. package/package.json +55 -16
  218. package/dist/src/constants/legacy-tags.d.ts +0 -79
  219. package/dist/src/constants/legacy-tags.d.ts.map +0 -1
  220. package/dist/src/constants/legacy-tags.js +0 -80
  221. package/dist/src/mod.d.ts +0 -10
  222. package/dist/src/mod.d.ts.map +0 -1
  223. package/dist/src/mod.js +0 -15
  224. package/dist/src/runtime/length-prefix-protocol.d.ts +0 -34
  225. package/dist/src/runtime/length-prefix-protocol.d.ts.map +0 -1
  226. package/dist/src/runtime/length-prefix-protocol.js +0 -49
  227. package/dist/src/runtime/wasmtime-sidecar.d.ts +0 -53
  228. package/dist/src/runtime/wasmtime-sidecar.d.ts.map +0 -1
  229. package/dist/src/runtime/wasmtime-sidecar.js +0 -182
  230. package/dist/src/simple/field-constants.d.ts +0 -11
  231. package/dist/src/simple/field-constants.d.ts.map +0 -1
  232. package/dist/src/simple/field-constants.js +0 -22
  233. package/dist/src/taglib/audio-file-extended.d.ts +0 -28
  234. package/dist/src/taglib/audio-file-extended.d.ts.map +0 -1
  235. package/dist/src/taglib/audio-file-extended.js +0 -73
  236. package/dist/src/wasm-workers.d.ts +0 -44
  237. package/dist/src/wasm-workers.d.ts.map +0 -1
  238. package/dist/src/wasm-workers.js +0 -127
  239. package/dist/src/worker-pool/global-pool.d.ts +0 -21
  240. package/dist/src/worker-pool/global-pool.d.ts.map +0 -1
  241. package/dist/src/worker-pool/global-pool.js +0 -22
  242. package/dist/src/worker-pool/index.d.ts +0 -10
  243. package/dist/src/worker-pool/index.d.ts.map +0 -1
  244. package/dist/src/worker-pool/index.js +0 -12
  245. package/dist/src/worker-pool/pool-initialization.d.ts +0 -7
  246. package/dist/src/worker-pool/pool-initialization.d.ts.map +0 -1
  247. package/dist/src/worker-pool/pool-initialization.js +0 -67
  248. package/dist/src/worker-pool/pool.d.ts +0 -39
  249. package/dist/src/worker-pool/pool.d.ts.map +0 -1
  250. package/dist/src/worker-pool/pool.js +0 -173
  251. package/dist/src/worker-pool/types.d.ts +0 -72
  252. package/dist/src/worker-pool/types.d.ts.map +0 -1
  253. package/dist/src/workers/audio-file-workers.d.ts +0 -85
  254. package/dist/src/workers/audio-file-workers.d.ts.map +0 -1
  255. package/dist/src/workers/audio-file-workers.js +0 -252
  256. package/dist/src/workers/batch-handler.d.ts +0 -17
  257. package/dist/src/workers/batch-handler.d.ts.map +0 -1
  258. package/dist/src/workers/batch-handler.js +0 -82
  259. package/dist/src/workers/index.d.ts +0 -12
  260. package/dist/src/workers/index.d.ts.map +0 -1
  261. package/dist/src/workers/index.js +0 -7
  262. package/dist/src/workers/taglib-worker.d.ts +0 -2
  263. package/dist/src/workers/taglib-worker.d.ts.map +0 -1
  264. package/dist/src/workers/taglib-worker.js +0 -116
  265. package/dist/src/workers/taglib-workers.d.ts +0 -95
  266. package/dist/src/workers/taglib-workers.d.ts.map +0 -1
  267. package/dist/src/workers/taglib-workers.js +0 -173
  268. /package/dist/src/{worker-pool/types.js → types/format-property-keys.js} +0 -0
package/LICENSE CHANGED
@@ -44,4 +44,4 @@ To rebuild the WebAssembly binary with a modified TagLib:
44
44
  3. The new binary will be in build/taglib.wasm
45
45
 
46
46
  For more information about LGPL compliance and dual licensing, see:
47
- https://github.com/CharlesWiltgen/taglib-wasm#licensing
47
+ https://github.com/CharlesWiltgen/TagLib-Wasm#licensing
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # TagLib-Wasm
2
2
 
3
- [![Tests](https://github.com/CharlesWiltgen/taglib-wasm/actions/workflows/test.yml/badge.svg)](https://github.com/CharlesWiltgen/taglib-wasm/actions/workflows/test.yml)
3
+ [![Tests](https://github.com/CharlesWiltgen/TagLib-Wasm/actions/workflows/test.yml/badge.svg)](https://github.com/CharlesWiltgen/TagLib-Wasm/actions/workflows/test.yml)
4
4
  [![npm version](https://img.shields.io/npm/v/taglib-wasm.svg)](https://www.npmjs.com/package/taglib-wasm)
5
5
  [![npm downloads](https://img.shields.io/npm/dm/taglib-wasm.svg)](https://www.npmjs.com/package/taglib-wasm)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/CharlesWiltgen/taglib-wasm/blob/main/LICENSE)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/CharlesWiltgen/TagLib-Wasm/blob/main/LICENSE)
7
7
  <br>[![Built with](https://img.shields.io/badge/TypeScript-5-3178c6.svg?logo=typescript&logoColor=f5f5f5)](https://www.typescriptlang.org/)
8
8
  [![Built with Emscripten](https://img.shields.io/badge/Built%20with-Emscripten-4B9BFF.svg)](https://emscripten.org/)
9
9
  [![Built with WebAssembly](https://img.shields.io/badge/Built%20with-WebAssembly-654ff0.svg?logo=webassembly&logoColor=white)](https://webassembly.org/)
@@ -52,9 +52,10 @@ import { TagLib } from "@charlesw/taglib-wasm";
52
52
  npm install taglib-wasm
53
53
  ```
54
54
 
55
- > **Note:** Requires Node.js v22.6.0 or higher. If you want to use the
56
- > TypeScript version with Node.js, see the
57
- > [installation guide](https://charleswiltgen.github.io/taglib-wasm/guide/installation.html).
55
+ > **Note:** Requires Node.js v22.6.0 or higher (for WebAssembly exception
56
+ > handling and `import.meta.url` support). If you want to use the TypeScript
57
+ > version with Node.js, see the
58
+ > [installation guide](https://charleswiltgen.github.io/TagLib-Wasm/guide/installation.html).
58
59
 
59
60
  ### Bun
60
61
 
@@ -98,7 +99,7 @@ const taglib = await initializeForDenoCompile();
98
99
  ```
99
100
 
100
101
  See the
101
- [complete Deno compile guide](https://charleswiltgen.github.io/taglib-wasm/guide/deno-compile.html)
102
+ [complete Deno compile guide](https://charleswiltgen.github.io/TagLib-Wasm/guide/deno-compile.html)
102
103
  for more options including CDN loading.
103
104
 
104
105
  For manual control:
@@ -119,11 +120,11 @@ const taglib = await TagLib.initialize({ wasmBinary });
119
120
  ### Simple API
120
121
 
121
122
  ```typescript
122
- import { applyTags, readTags, updateTags } from "taglib-wasm/simple";
123
+ import { applyTags, applyTagsToFile, readTags } from "taglib-wasm/simple";
123
124
 
124
- // Read tags
125
+ // Read tags (string fields are arrays to support multi-value metadata)
125
126
  const tags = await readTags("song.mp3");
126
- console.log(tags.title, tags.artist, tags.album);
127
+ console.log(tags.title?.[0], tags.artist?.[0], tags.album?.[0]);
127
128
 
128
129
  // Apply tags and get modified buffer (in-memory)
129
130
  const modifiedBuffer = await applyTags("song.mp3", {
@@ -133,7 +134,7 @@ const modifiedBuffer = await applyTags("song.mp3", {
133
134
  });
134
135
 
135
136
  // Or update tags on disk (requires file path)
136
- await updateTags("song.mp3", {
137
+ await applyTagsToFile("song.mp3", {
137
138
  title: "New Title",
138
139
  artist: "New Artist",
139
140
  });
@@ -191,18 +192,23 @@ import { findDuplicates, scanFolder } from "taglib-wasm";
191
192
  // Scan a music library
192
193
  const result = await scanFolder("/path/to/music", {
193
194
  recursive: true,
194
- concurrency: 4,
195
195
  onProgress: (processed, total, file) => {
196
196
  console.log(`Processing ${processed}/${total}: ${file}`);
197
197
  },
198
198
  });
199
199
 
200
- console.log(`Found ${result.totalFound} audio files`);
201
- console.log(`Successfully processed ${result.totalProcessed} files`);
200
+ console.log(`Found ${result.items.length} audio files`);
201
+ console.log(
202
+ `Successfully processed ${
203
+ result.items.filter((i) => i.status === "ok").length
204
+ } files`,
205
+ );
202
206
 
203
207
  // Process results
204
- for (const file of result.files) {
205
- console.log(`${file.path}: ${file.tags.artist} - ${file.tags.title}`);
208
+ for (const file of result.items) {
209
+ console.log(
210
+ `${file.path}: ${file.tags.artist?.[0]} - ${file.tags.title?.[0]}`,
211
+ );
206
212
  console.log(`Duration: ${file.properties?.duration}s`);
207
213
  }
208
214
 
@@ -249,7 +255,7 @@ file.setRating(0.8);
249
255
  file.save();
250
256
  ```
251
257
 
252
- See the [Track Ratings Guide](https://charleswiltgen.github.io/taglib-wasm/guide/ratings.html)
258
+ See the [Track Ratings Guide](https://charleswiltgen.github.io/TagLib-Wasm/guide/ratings.html)
253
259
  for RatingUtils API and cross-format conversion details.
254
260
 
255
261
  ### Container Format and Codec Detection
@@ -266,7 +272,7 @@ console.log(props.isLossless); // false for AAC, true for ALAC
266
272
  console.log(props.bitsPerSample); // 16 for most formats
267
273
  console.log(props.bitrate); // 256 (kbps)
268
274
  console.log(props.sampleRate); // 44100 (Hz)
269
- console.log(props.length); // 180 (duration in seconds)
275
+ console.log(props.duration); // 180 (duration in seconds)
270
276
  ```
271
277
 
272
278
  Container format vs Codec:
@@ -285,26 +291,26 @@ Supported formats:
285
291
 
286
292
  ## Documentation
287
293
 
288
- **[View Full Documentation](https://charleswiltgen.github.io/taglib-wasm/)**
294
+ **[View Full Documentation](https://charleswiltgen.github.io/TagLib-Wasm/)**
289
295
 
290
296
  ### Getting Started
291
297
 
292
- - [Installation Guide](https://charleswiltgen.github.io/taglib-wasm/guide/installation.html)
293
- - [Quick Start Tutorial](https://charleswiltgen.github.io/taglib-wasm/guide/quick-start.html)
294
- - [All Examples](https://charleswiltgen.github.io/taglib-wasm/guide/examples.html)
298
+ - [Installation Guide](https://charleswiltgen.github.io/TagLib-Wasm/guide/installation.html)
299
+ - [Quick Start Tutorial](https://charleswiltgen.github.io/TagLib-Wasm/guide/quick-start.html)
300
+ - [All Examples](https://charleswiltgen.github.io/TagLib-Wasm/guide/examples.html)
295
301
 
296
302
  ### Guides
297
303
 
298
- - [API Reference](https://charleswiltgen.github.io/taglib-wasm/api/)
299
- - [Performance Guide](https://charleswiltgen.github.io/taglib-wasm/concepts/performance.html)
300
- - [Album Processing Guide](https://charleswiltgen.github.io/taglib-wasm/guide/album-processing.html) - Process entire albums in seconds
301
- - [Platform Examples](https://charleswiltgen.github.io/taglib-wasm/guide/platform-examples.html)
302
- - [Working with Cover Art](https://charleswiltgen.github.io/taglib-wasm/guide/cover-art.html)
303
- - [Track Ratings](https://charleswiltgen.github.io/taglib-wasm/guide/ratings.html)
304
- - [Cloudflare Workers Setup](https://charleswiltgen.github.io/taglib-wasm/guide/workers-setup.html)
305
- - [Error Handling](https://charleswiltgen.github.io/taglib-wasm/concepts/error-handling.html)
306
-
304
+ - [API Reference](https://charleswiltgen.github.io/TagLib-Wasm/api/)
305
+ - [Performance Guide](https://charleswiltgen.github.io/TagLib-Wasm/concepts/performance.html)
306
+ - [Album Processing Guide](https://charleswiltgen.github.io/TagLib-Wasm/guide/album-processing.html)
307
+ - [Platform Examples](https://charleswiltgen.github.io/TagLib-Wasm/guide/platform-examples.html)
308
+ - [Working with Cover Art](https://charleswiltgen.github.io/TagLib-Wasm/guide/cover-art.html)
309
+ - [Track Ratings](https://charleswiltgen.github.io/TagLib-Wasm/guide/ratings.html)
310
+ - [Cloudflare Workers](https://charleswiltgen.github.io/TagLib-Wasm/advanced/cloudflare-workers.html)
311
+ - [Error Handling](https://charleswiltgen.github.io/TagLib-Wasm/concepts/error-handling.html)
307
312
  - [Contributing](CONTRIBUTING.md)
313
+ - [AI Agent Documentation](AGENTS.md)
308
314
 
309
315
  ## Supported Formats
310
316
 
@@ -380,49 +386,25 @@ await file.saveToFile(); // Full file loaded only here
380
386
 
381
387
  taglib-wasm auto-selects the fastest available backend — no configuration needed:
382
388
 
383
- | Environment | Backend | How it works | Performance |
384
- | ------------------------ | ----------------- | ------------------------------------------------------ | -------------- |
385
- | **Deno / Node.js / Bun** | WASI (auto) | Seek-based filesystem I/O; reads only headers and tags | Fastest |
386
- | **Browsers / Workers** | Emscripten (auto) | Entire file loaded into memory as buffer | Baseline |
387
- | **Opt-in** | Wasmtime sidecar | Out-of-process WASI with direct filesystem access | Best for batch |
389
+ | Environment | Backend | How it works | Performance |
390
+ | ------------------------ | ----------------- | ------------------------------------------------------ | ----------- |
391
+ | **Deno / Node.js / Bun** | WASI (auto) | Seek-based filesystem I/O; reads only headers and tags | Fastest |
392
+ | **Browsers / Workers** | Emscripten (auto) | Entire file loaded into memory as buffer | Baseline |
388
393
 
389
- On Deno, Node.js, and Bun you get WASI automatically — nothing to configure. For
390
- heavy batch workloads, the optional Wasmtime sidecar provides direct filesystem
391
- access via a sandboxed subprocess:
392
-
393
- ```bash
394
- # Optional: Install Wasmtime for sidecar mode
395
- curl https://wasmtime.dev/install.sh -sSf | bash
396
- ```
397
-
398
- ```typescript
399
- import { readTags, setSidecarConfig } from "taglib-wasm/simple";
400
-
401
- // Enable sidecar mode (requires Wasmtime)
402
- await setSidecarConfig({
403
- preopens: { "/music": "/home/user/Music" },
404
- });
405
-
406
- // Now path-based calls use direct WASI filesystem access
407
- const tags = await readTags("/music/song.mp3");
408
- ```
409
-
410
- See the
411
- [Runtime Compatibility Guide](https://charleswiltgen.github.io/taglib-wasm/concepts/runtime-compatibility.html)
412
- for full sidecar configuration options.
394
+ On Deno, Node.js, and Bun you get WASI automatically — nothing to configure.
413
395
 
414
396
  ## Runtime Compatibility
415
397
 
416
398
  `taglib-wasm` works across all major JavaScript runtimes:
417
399
 
418
- | Runtime | Status | Installation | Notes |
419
- | ---------------------- | ------- | ------------------------- | ------------------------------------------------------------------------------------------------------- |
420
- | **Deno** | Full | `npm:taglib-wasm` | Native TypeScript |
421
- | **Node.js** | Full | `npm install taglib-wasm` | TypeScript via tsx |
422
- | **Bun** | Partial | `bun add taglib-wasm` | Import + init verified; full test suite is Deno-only |
423
- | **Browser** | Full | Via bundler | Full API support |
424
- | **Cloudflare Workers** | Partial | `taglib-wasm/workers` | Basic tags only; see [Workers limitations](docs/advanced/cloudflare-workers.md#workers-api-limitations) |
425
- | **Electron** | Node.js | `npm install taglib-wasm` | Main process; renderer via IPC |
400
+ | Runtime | Status | Installation | Notes |
401
+ | ---------------------- | ------- | ------------------------- | -------------------------------------------------------------------------- |
402
+ | **Deno** | Full | `npm:taglib-wasm` | Native TypeScript |
403
+ | **Node.js** | Full | `npm install taglib-wasm` | TypeScript via tsx |
404
+ | **Bun** | Partial | `bun add taglib-wasm` | Import + init verified; full test suite is Deno-only |
405
+ | **Browser** | Full | Via bundler | Full API support |
406
+ | **Cloudflare Workers** | Full | `npm install taglib-wasm` | Same unified API; see [Workers guide](docs/advanced/cloudflare-workers.md) |
407
+ | **Electron** | Node.js | `npm install taglib-wasm` | Main process; renderer via IPC |
426
408
 
427
409
  ## Known Limitations
428
410
 
@@ -430,8 +412,6 @@ for full sidecar configuration options.
430
412
  into memory. On Deno/Node.js, WASI reads only headers and tags from disk.
431
413
  - **Concurrent Access** – Not thread-safe (JavaScript single-threaded nature
432
414
  mitigates this)
433
- - **Cloudflare Workers** – Limited to 128MB memory per request; files larger
434
- than ~100MB may fail
435
415
 
436
416
  ## Contributing
437
417
 
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Folder scanning and batch operations for audio file collections.
3
+ *
4
+ * @module folder
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { scanFolder, findDuplicates } from "@charlesw/taglib-wasm/folder";
9
+ *
10
+ * const result = await scanFolder("/path/to/music");
11
+ * for (const item of result.items) {
12
+ * if (item.status === "ok") {
13
+ * console.log(`${item.path}: ${item.tags.artist} - ${item.tags.title}`);
14
+ * }
15
+ * }
16
+ * ```
17
+ */
18
+ export * from "./src/folder-api/index.js";
19
+ //# sourceMappingURL=folder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"folder.d.ts","sourceRoot":"","sources":["../folder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,2BAA2B,CAAC"}
package/dist/folder.js ADDED
@@ -0,0 +1,2 @@
1
+ // folder.ts
2
+ export * from "./src/folder-api/index.js";
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @fileoverview Main module exports for taglib-wasm
2
+ * @fileoverview Main module exports for TagLib-Wasm
3
3
  *
4
4
  * TagLib v2.1 compiled to WebAssembly with TypeScript bindings
5
5
  * for universal audio metadata handling across all JavaScript runtimes.
6
6
  *
7
- * @module taglib-wasm
7
+ * @module TagLib-Wasm
8
8
  *
9
9
  * @example
10
10
  * ```typescript
@@ -32,26 +32,27 @@
32
32
  * });
33
33
  * ```
34
34
  */
35
- export { AudioFileImpl as AudioFile, TagLib } from "./src/taglib.ts";
36
- export type { MutableTag } from "./src/taglib.ts";
37
- export { EnvironmentError, FileOperationError, InvalidFormatError, isEnvironmentError, isFileOperationError, isInvalidFormatError, isMemoryError, isMetadataError, isSidecarError, isTagLibError, isUnsupportedFormatError, isWorkerError, MemoryError, MetadataError, SidecarError, SUPPORTED_FORMATS, TagLibError, TagLibInitializationError, UnsupportedFormatError, WorkerError, } from "./src/errors.ts";
38
- export type { TagLibErrorCode } from "./src/errors.ts";
39
- export { initializeForDenoCompile, isDenoCompiled, prepareWasmForEmbedding, } from "./src/deno-compile.ts";
40
- export { addPicture, applyCoverArt, applyPictures, applyTags, applyTagsToBuffer, type BatchOptions, type BatchResult, clearPictures, clearTags, findPictureByType, isValidAudioFile, readCoverArt, readFormat, readMetadataBatch, readPictureMetadata, readPictures, readProperties, readPropertiesBatch, readTags, readTagsBatch, replacePictureByType, setBufferMode, setSidecarConfig, setWorkerPoolMode, updateTags, writeTagsToFile, } from "./src/simple/index.ts";
41
- export { FormatMappings, getAllProperties, getAllPropertyKeys, getAllTagNames, getPropertiesByFormat, getPropertyMetadata, isValidProperty, isValidTagName, PROPERTIES, Tags, } from "./src/constants.ts";
42
- export type { PropertyMetadata } from "./src/constants/property-types.ts";
43
- export { copyCoverArt, exportAllPictures, exportCoverArt, exportPictureByType, findCoverArtFiles, importCoverArt, importPictureWithType, loadPictureFromFile, savePictureToFile, } from "./src/file-utils/index.ts";
44
- export { type AudioDynamics, type AudioFileMetadata, exportFolderMetadata, findDuplicates, type FolderScanOptions, type FolderScanResult, scanFolder, updateFolderTags, } from "./src/folder-api/index.ts";
45
- export { canvasToPicture, createPictureDownloadURL, createPictureGallery, dataURLToPicture, displayPicture, imageFileToPicture, pictureToDataURL, setCoverArtFromCanvas, } from "./src/web-utils/index.ts";
46
- export type { AudioFileInput, AudioFormat, AudioProperties, BitrateControlMode, ExtendedTag, FieldMapping, FileType, OpenOptions, Picture, PictureType, PropertyMap, Tag, TagName, } from "./src/types.ts";
47
- export { BITRATE_CONTROL_MODE_NAMES, BITRATE_CONTROL_MODE_VALUES, PICTURE_TYPE_NAMES, PICTURE_TYPE_VALUES, } from "./src/types.ts";
48
- export type { PropertyKey, PropertyValue } from "./src/constants.ts";
49
- export { COMPLEX_PROPERTIES, COMPLEX_PROPERTY_KEY, } from "./src/constants/complex-properties.ts";
50
- export type { ComplexPropertyKey, ComplexPropertyKeyMap, ComplexPropertyValueMap, Rating, UnsyncedLyrics, VariantMap, } from "./src/constants/complex-properties.ts";
51
- export { clamp as clampRating, fromNormalized, fromPercent, fromPopm, fromStars, isValid as isValidRating, RatingUtils, toNormalized, toPercent, toPopm, toStars, } from "./src/utils/rating.ts";
52
- export { createWorkerPool, getGlobalWorkerPool, TagLibWorkerPool, terminateGlobalWorkerPool, } from "./src/worker-pool/index.ts";
53
- export type { BatchOperation, WorkerPoolOptions, WorkerTask, } from "./src/worker-pool/index.ts";
54
- export type { TagLibModule, WasmModule } from "./src/wasm.ts";
55
- export type { LoadTagLibOptions } from "./src/runtime/loader-types.ts";
56
- export { loadTagLibModule } from "./src/runtime/module-loader.ts";
35
+ export type { AudioFile, TypedAudioFile, } from "./src/taglib/audio-file-interface.js";
36
+ export { AudioFileImpl, createTagLib, TagLib } from "./src/taglib.js";
37
+ export type { MutableTag } from "./src/taglib.js";
38
+ export { EnvironmentError, FileOperationError, InvalidFormatError, isEnvironmentError, isFileOperationError, isInvalidFormatError, isMemoryError, isMetadataError, isTagLibError, isUnsupportedFormatError, MemoryError, MetadataError, SUPPORTED_FORMATS, TagLibError, TagLibInitializationError, UnsupportedFormatError, } from "./src/errors.js";
39
+ export type { TagLibErrorCode } from "./src/errors.js";
40
+ export { initializeForDenoCompile, isDenoCompiled, prepareWasmForEmbedding, } from "./src/deno-compile.js";
41
+ export { addPicture, applyCoverArt, applyPictures, applyTags, applyTagsToFile, type BatchItem, type BatchOptions, type BatchResult, clearPictures, clearTags, type FileMetadata, findPictureByType, isValidAudioFile, readCoverArt, readFormat, readMetadata, readMetadataBatch, readPictureMetadata, readPictures, readProperties, readPropertiesBatch, readTags, readTagsBatch, replacePictureByType, setBufferMode, } from "./src/simple/index.js";
42
+ export { FormatMappings, getAllProperties, getAllPropertyKeys, getAllTagNames, getPropertiesByFormat, getPropertyMetadata, isValidProperty, isValidTagName, PROPERTIES, Tags, } from "./src/constants.js";
43
+ export type { PropertyMetadata } from "./src/constants/property-types.js";
44
+ export { copyCoverArt, exportAllPictures, exportCoverArt, exportPictureByType, findCoverArtFiles, importCoverArt, importPictureWithType, loadPictureFromFile, savePictureToFile, } from "./src/file-utils/index.js";
45
+ export { type AudioDynamics, type AudioFileMetadata, type DuplicateGroup, exportFolderMetadata, findDuplicates, type FolderScanItem, type FolderScanOptions, type FolderScanResult, type FolderUpdateItem, type FolderUpdateResult, scanFolder, updateFolderTags, } from "./src/folder-api/index.js";
46
+ export { canvasToPicture, createPictureDownloadURL, createPictureGallery, dataURLToPicture, displayPicture, imageFileToPicture, pictureToDataURL, setCoverArtFromCanvas, } from "./src/web-utils/index.js";
47
+ export type { AudioCodec, AudioFileInput, AudioProperties, BitrateControlMode, ContainerFormat, ExtendedTag, FieldMapping, FileType, OpenOptions, Picture, PictureType, PropertyMap, Tag, TagInput, TagName, } from "./src/types.js";
48
+ export { BITRATE_CONTROL_MODE_NAMES, BITRATE_CONTROL_MODE_VALUES, PICTURE_TYPE_NAMES, PICTURE_TYPE_VALUES, } from "./src/types.js";
49
+ export type { PropertyKey, PropertyValue } from "./src/constants.js";
50
+ export type { FormatPropertyKey, TagFormat, } from "./src/types/format-property-keys.js";
51
+ export { COMPLEX_PROPERTIES, COMPLEX_PROPERTY_KEY, } from "./src/constants/complex-properties.js";
52
+ export type { ComplexPropertyKey, ComplexPropertyKeyMap, ComplexPropertyValueMap, Rating, UnsyncedLyrics, VariantMap, } from "./src/constants/complex-properties.js";
53
+ export { RatingUtils } from "./src/utils/rating.js";
54
+ export type { NormalizedRating, PopmRating } from "./src/utils/rating.js";
55
+ export type { TagLibModule, WasmModule } from "./src/wasm.js";
56
+ export type { LoadTagLibOptions } from "./src/runtime/loader-types.js";
57
+ export { loadTagLibModule } from "./src/runtime/module-loader.js";
57
58
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,EAAE,aAAa,IAAI,SAAS,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACrE,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,cAAc,EACd,aAAa,EACb,wBAAwB,EACxB,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,yBAAyB,EACzB,sBAAsB,EACtB,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,UAAU,EACV,aAAa,EACb,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,QAAQ,EACR,aAAa,EACb,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,eAAe,G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,OAAO,EACP,WAAW,EACX,WAAW,EACX,GAAG,EACH,QAAQ,EACR,OAAO,GACR,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACrE,YAAY,EACV,iBAAiB,EACjB,SAAS,GACV,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EACL,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,uCAAuC,CAAC;AAC/C,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,MAAM,EACN,cAAc,EACd,UAAU,GACX,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAG1E,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // index.ts
2
- import { AudioFileImpl, TagLib } from "./src/taglib.js";
2
+ import { AudioFileImpl, createTagLib, TagLib } from "./src/taglib.js";
3
3
  import {
4
4
  EnvironmentError,
5
5
  FileOperationError,
@@ -9,18 +9,14 @@ import {
9
9
  isInvalidFormatError,
10
10
  isMemoryError,
11
11
  isMetadataError,
12
- isSidecarError,
13
12
  isTagLibError,
14
13
  isUnsupportedFormatError,
15
- isWorkerError,
16
14
  MemoryError,
17
15
  MetadataError,
18
- SidecarError,
19
16
  SUPPORTED_FORMATS,
20
17
  TagLibError,
21
18
  TagLibInitializationError,
22
- UnsupportedFormatError,
23
- WorkerError
19
+ UnsupportedFormatError
24
20
  } from "./src/errors.js";
25
21
  import {
26
22
  initializeForDenoCompile,
@@ -32,13 +28,14 @@ import {
32
28
  applyCoverArt,
33
29
  applyPictures,
34
30
  applyTags,
35
- applyTagsToBuffer,
31
+ applyTagsToFile,
36
32
  clearPictures,
37
33
  clearTags,
38
34
  findPictureByType,
39
35
  isValidAudioFile,
40
36
  readCoverArt,
41
37
  readFormat,
38
+ readMetadata,
42
39
  readMetadataBatch,
43
40
  readPictureMetadata,
44
41
  readPictures,
@@ -47,11 +44,7 @@ import {
47
44
  readTags,
48
45
  readTagsBatch,
49
46
  replacePictureByType,
50
- setBufferMode,
51
- setSidecarConfig,
52
- setWorkerPoolMode,
53
- updateTags,
54
- writeTagsToFile
47
+ setBufferMode
55
48
  } from "./src/simple/index.js";
56
49
  import {
57
50
  FormatMappings,
@@ -102,28 +95,10 @@ import {
102
95
  COMPLEX_PROPERTIES,
103
96
  COMPLEX_PROPERTY_KEY
104
97
  } from "./src/constants/complex-properties.js";
105
- import {
106
- clamp,
107
- fromNormalized,
108
- fromPercent,
109
- fromPopm,
110
- fromStars,
111
- isValid,
112
- RatingUtils,
113
- toNormalized,
114
- toPercent,
115
- toPopm,
116
- toStars
117
- } from "./src/utils/rating.js";
118
- import {
119
- createWorkerPool,
120
- getGlobalWorkerPool,
121
- TagLibWorkerPool,
122
- terminateGlobalWorkerPool
123
- } from "./src/worker-pool/index.js";
98
+ import { RatingUtils } from "./src/utils/rating.js";
124
99
  import { loadTagLibModule } from "./src/runtime/module-loader.js";
125
100
  export {
126
- AudioFileImpl as AudioFile,
101
+ AudioFileImpl,
127
102
  BITRATE_CONTROL_MODE_NAMES,
128
103
  BITRATE_CONTROL_MODE_VALUES,
129
104
  COMPLEX_PROPERTIES,
@@ -139,27 +114,23 @@ export {
139
114
  PROPERTIES,
140
115
  RatingUtils,
141
116
  SUPPORTED_FORMATS,
142
- SidecarError,
143
117
  TagLib,
144
118
  TagLibError,
145
119
  TagLibInitializationError,
146
- TagLibWorkerPool,
147
120
  Tags,
148
121
  UnsupportedFormatError,
149
- WorkerError,
150
122
  addPicture,
151
123
  applyCoverArt,
152
124
  applyPictures,
153
125
  applyTags,
154
- applyTagsToBuffer,
126
+ applyTagsToFile,
155
127
  canvasToPicture,
156
- clamp as clampRating,
157
128
  clearPictures,
158
129
  clearTags,
159
130
  copyCoverArt,
160
131
  createPictureDownloadURL,
161
132
  createPictureGallery,
162
- createWorkerPool,
133
+ createTagLib,
163
134
  dataURLToPicture,
164
135
  displayPicture,
165
136
  exportAllPictures,
@@ -169,14 +140,9 @@ export {
169
140
  findCoverArtFiles,
170
141
  findDuplicates,
171
142
  findPictureByType,
172
- fromNormalized,
173
- fromPercent,
174
- fromPopm,
175
- fromStars,
176
143
  getAllProperties,
177
144
  getAllPropertyKeys,
178
145
  getAllTagNames,
179
- getGlobalWorkerPool,
180
146
  getPropertiesByFormat,
181
147
  getPropertyMetadata,
182
148
  imageFileToPicture,
@@ -189,20 +155,18 @@ export {
189
155
  isInvalidFormatError,
190
156
  isMemoryError,
191
157
  isMetadataError,
192
- isSidecarError,
193
158
  isTagLibError,
194
159
  isUnsupportedFormatError,
195
160
  isValidAudioFile,
196
161
  isValidProperty,
197
- isValid as isValidRating,
198
162
  isValidTagName,
199
- isWorkerError,
200
163
  loadPictureFromFile,
201
164
  loadTagLibModule,
202
165
  pictureToDataURL,
203
166
  prepareWasmForEmbedding,
204
167
  readCoverArt,
205
168
  readFormat,
169
+ readMetadata,
206
170
  readMetadataBatch,
207
171
  readPictureMetadata,
208
172
  readPictures,
@@ -215,14 +179,5 @@ export {
215
179
  scanFolder,
216
180
  setBufferMode,
217
181
  setCoverArtFromCanvas,
218
- setSidecarConfig,
219
- setWorkerPoolMode,
220
- terminateGlobalWorkerPool,
221
- toNormalized,
222
- toPercent,
223
- toPopm,
224
- toStars,
225
- updateFolderTags,
226
- updateTags,
227
- writeTagsToFile
182
+ updateFolderTags
228
183
  };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Rating conversion utilities for cross-format compatibility.
3
+ *
4
+ * @module rating
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { toStars, fromStars, toPopm } from "@charlesw/taglib-wasm/rating";
9
+ *
10
+ * const normalized = fromStars(4, 5); // 0.8
11
+ * const popm = toPopm(0.8); // 196
12
+ * ```
13
+ */
14
+ export * from "./src/utils/rating.js";
15
+ //# sourceMappingURL=rating.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rating.d.ts","sourceRoot":"","sources":["../rating.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,cAAc,uBAAuB,CAAC"}
package/dist/rating.js ADDED
@@ -0,0 +1,2 @@
1
+ // rating.ts
2
+ export * from "./src/utils/rating.js";
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Simple API for reading and writing audio metadata with minimal code.
3
+ *
4
+ * @module simple
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * import { readTags, applyTags } from "@charlesw/taglib-wasm/simple";
9
+ *
10
+ * // Read tags from a file
11
+ * const tags = await readTags(audioBuffer);
12
+ * console.log(tags.title, tags.artist);
13
+ *
14
+ * // Apply tags and get modified buffer
15
+ * const modified = await applyTags(audioBuffer, {
16
+ * title: "New Title",
17
+ * artist: "New Artist"
18
+ * });
19
+ * ```
20
+ */
21
+ export * from "./src/simple/index.js";
22
+ //# sourceMappingURL=simple.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../simple.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,uBAAuB,CAAC"}
package/dist/simple.js ADDED
@@ -0,0 +1,2 @@
1
+ // simple.ts
2
+ export * from "./src/simple/index.js";
@@ -3,7 +3,7 @@
3
3
  * These are the core tags that most audio files should have.
4
4
  */
5
5
  export declare const BASIC_PROPERTIES: {
6
- readonly TITLE: {
6
+ readonly title: {
7
7
  readonly key: "TITLE";
8
8
  readonly description: "The title of the track";
9
9
  readonly type: "string";
@@ -17,7 +17,7 @@ export declare const BASIC_PROPERTIES: {
17
17
  readonly wav: "INAM";
18
18
  };
19
19
  };
20
- readonly ARTIST: {
20
+ readonly artist: {
21
21
  readonly key: "ARTIST";
22
22
  readonly description: "The primary performer(s) of the track";
23
23
  readonly type: "string";
@@ -31,7 +31,7 @@ export declare const BASIC_PROPERTIES: {
31
31
  readonly wav: "IART";
32
32
  };
33
33
  };
34
- readonly ALBUM: {
34
+ readonly album: {
35
35
  readonly key: "ALBUM";
36
36
  readonly description: "The album/collection name";
37
37
  readonly type: "string";
@@ -45,7 +45,7 @@ export declare const BASIC_PROPERTIES: {
45
45
  readonly wav: "IPRD";
46
46
  };
47
47
  };
48
- readonly DATE: {
48
+ readonly date: {
49
49
  readonly key: "DATE";
50
50
  readonly description: "The date of recording (typically year)";
51
51
  readonly type: "string";
@@ -59,7 +59,7 @@ export declare const BASIC_PROPERTIES: {
59
59
  readonly wav: "ICRD";
60
60
  };
61
61
  };
62
- readonly TRACKNUMBER: {
62
+ readonly trackNumber: {
63
63
  readonly key: "TRACKNUMBER";
64
64
  readonly description: "The track number within the album";
65
65
  readonly type: "string";
@@ -73,7 +73,7 @@ export declare const BASIC_PROPERTIES: {
73
73
  readonly wav: "ITRK";
74
74
  };
75
75
  };
76
- readonly GENRE: {
76
+ readonly genre: {
77
77
  readonly key: "GENRE";
78
78
  readonly description: "The musical genre";
79
79
  readonly type: "string";
@@ -87,7 +87,7 @@ export declare const BASIC_PROPERTIES: {
87
87
  readonly wav: "IGNR";
88
88
  };
89
89
  };
90
- readonly COMMENT: {
90
+ readonly comment: {
91
91
  readonly key: "COMMENT";
92
92
  readonly description: "Comments or notes about the track";
93
93
  readonly type: "string";
@@ -1 +1 @@
1
- {"version":3,"file":"basic-properties.d.ts","sourceRoot":"","sources":["../../../src/constants/basic-properties.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFnB,CAAC"}
1
+ {"version":3,"file":"basic-properties.d.ts","sourceRoot":"","sources":["../../../src/constants/basic-properties.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFnB,CAAC"}