id3-parser is a pure JavaScript library designed for parsing ID3 tags (versions 1 and 2.3) from MP3 audio files. The current stable version, 3.0.0, requires Node.js version 16 or newer. It offers a straightforward API with a primary `parse` function that intelligently detects and extracts metadata, alongside specific functions like `parseV1Tag` and `parseV2Tag` for targeted parsing. The library ships with TypeScript types, ensuring good developer experience in modern TypeScript and JavaScript environments. While primarily used in Node.js for server-side processing, it includes utilities (`convertFileToBuffer`, `fetchFileAsBuffer`) that facilitate its use in browser environments when bundled with tools like Webpack. Its key differentiators include its focus on robust parsing of common ID3v1 and ID3v2.3 frames, providing comprehensive metadata such as artist, album, title, year, comments, lyrics, and embedded cover art from binary data. The release cadence is typically driven by bug fixes, maintenance, and alignment with modern JavaScript ecosystem standards.
npm install id3-parserVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to fetch and parse ID3 tags from a remote MP3 URL, applicable to both browser (with utilities) and Node.js environments.
Upgrade your Node.js environment to version 16 or later. Consider using a Node.js version manager like `nvm` or `volta` to manage multiple Node.js versions.
Refactor your imports to use ES Modules syntax: `import parse from 'id3-parser';` for the default export and `import { namedExport } from 'id3-parser';` for named exports.Be aware that MP3s tagged with ID3v2.4 will only be partially parsed (or not at all if only v2.4 tags are present). If full ID3v2.4 support is required, consider alternative libraries or pre-processing files to convert tags to ID3v2.3 if possible. The library currently does not provide a direct upgrade path to v2.4.
Ensure your project uses a modern JavaScript bundler for browser deployment. Utilize `id3-parser/lib/util` functions for handling `File` objects or remote URLs in the browser.
Change your import statement from `const parse = require('id3-parser');` to `import parse from 'id3-parser';`. Ensure your project's `package.json` sets `"type": "module"` or you are using `.mjs` files if mixing ESM and CJS.Use `import parse from 'id3-parser';` for the default export. Avoid `import { parse } from 'id3-parser';` (which would be for a named export `parse`) or `import * as ID3Parser from 'id3-parser'; ID3Parser.parse(...)` if `parse` is the default export.In browser environments, use the provided utility functions from `id3-parser/lib/util`, specifically `convertFileToBuffer(file)` for `File` objects or `fetchFileAsBuffer(url)` for remote URLs. These functions will provide a `Uint8Array` or `number[]` which `parse` can handle, avoiding direct `Buffer` usage.
No dependency data recorded yet.