UNPKG

taglib-wasm

Version:

TagLib-Wasm is the universal tagging library for TypeScript/JavaScript platforms: Browsers, Node.js, Deno, Bun, Cloudflare Workers, and Electron apps

18 lines (17 loc) 426 B
import { EnvironmentError, FileOperationError } from "../errors.js"; import { getPlatformIO } from "../runtime/platform-io.js"; async function writeFileData(path, data) { try { await getPlatformIO().writeFile(path, data); } catch (error) { if (error instanceof EnvironmentError) throw error; throw new FileOperationError( "write", error.message, path ); } } export { writeFileData };