music-metadata is a robust and comprehensive JavaScript library for parsing audio file metadata in Node.js and browser environments (with appropriate bundlers). It supports an extensive array of audio formats including MP3, MP4, FLAC, Ogg, WAV, and AIFF, and extracts detailed metadata such as ID3v1, ID3v2, APE, Vorbis, and iTunes/MP4 tags. The current stable version is 11.12.3, with regular patch and minor releases addressing bugs, enhancing features, and updating internal dependencies. Key differentiators include its broad format and tag support, efficient streaming capabilities for handling large audio files, a modern promise-based API for asynchronous workflows, and cross-platform compatibility. It primarily operates as an ECMAScript Module (ESM) and requires Node.js version 18 or newer.
npm install music-metadataVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use `music-metadata` to parse metadata from a local audio file and a readable stream, including creating a dummy file for local testing.
Migrate your project to use ES Modules with `import` statements, or use a dynamic `import()` call for CJS environments.
Ensure your Node.js environment is updated to version 18 or newer. Check your `package.json`'s `engines` field.
Avoid using version 11.12.2; upgrade to 11.12.3 or later for correct TypeScript declaration inclusion.
Upgrade to version 11.12.2 or higher to receive the fix for the ASF parser infinite loop vulnerability.
Change `const { parseFile } = require('music-metadata');` to `import { parseFile } from 'music-metadata';` in your module. Ensure your project is configured for ES Modules (e.g., `"type": "module"` in `package.json`).Verify that the `filePath` provided to `parseFile` is correct, the file exists, and your application has the necessary read permissions.
Ensure the input file is a valid and supported audio format (e.g., MP3, FLAC, WAV). Check the file integrity if unsure.
No dependency data recorded yet.