npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

id3-wasm

v0.0.27

Published

Insanely quick ID3 reading & writing for JavaScript powered by WebAssembly.

Readme

id3-wasm

A high-performance library for reading and writing ID3 tags, powered by Rust and WebAssembly.

This package provides the core JavaScript interface for the id3-wasm module. For a live demonstration of its capabilities, please see the demo application.

Installation

pnpm add id3-wasm

or

npm install id3-wasm

Usage

The library can be used in both Node.js and modern browsers. It's fully compatible with Web Workers.

Initializing the Module

Before using any functions, you must initialize the WebAssembly module. In a browser environment with a bundler like Vite, this is often handled automatically. In Node.js or a test environment, you may need to do it explicitly.

import init from 'id3-wasm';

// This returns a promise that resolves when the Wasm module is ready.
await init();

Reading Metadata from an MP3 File

To read ID3 tags, create a TagController from a file buffer (Uint8Array) and then get the metadata from it.

import init, { TagController } from 'id3-wasm';
import * as fs from 'fs/promises';

// Initialize the Wasm module
await init();

// Example of reading a file in Node.js
const buffer = await fs.readFile('path/to/your/song.mp3');
const uint8Array = new Uint8Array(buffer);

let tagController;
let metadata;
try {
  tagController = TagController.from(uint8Array);
  metadata = tagController.getMetadata();

  console.log('Title:', metadata.title);
  console.log('Artist:', metadata.artist);
  console.log('Album:', metadata.album);
  console.log('Year:', metadata.year);

} catch (e) {
  console.error('Failed to read metadata:', e);
} finally {
  // IMPORTANT: The objects hold pointers to Wasm memory.
  // You MUST free them when you are done to avoid memory leaks.
  if (metadata) {
    metadata.free();
  }
  if (tagController) {
    tagController.free();
  }
}

Modifying Metadata

The TagController also allows you to modify tags and write them back into a new buffer.

import init, { TagController } from 'id3-wasm';
import * as fs from 'fs/promises';

await init();

const buffer = await fs.readFile('path/to/your/song.mp3');
const uint8Array = new Uint8Array(buffer);

let tagController;
try {
  tagController = TagController.from(uint8Array);

  // Change the metadata
  tagController.setTitle('A New Title');
  tagController.setArtist('A New Artist');
  tagController.setYear(2024);

  // The putTagInto method returns a *new* buffer with the updated tags.
  const newBuffer = tagController.putTagInto(uint8Array);

  // You can now save the newBuffer to a file
  await fs.writeFile('path/to/your/new-song.mp3', newBuffer);
  console.log('New file saved!');

} catch (e) {
  console.error('Failed to modify metadata:', e);
} finally {
  // IMPORTANT: The tagController also needs to be freed.
  if (tagController) {
    tagController.free();
  }
}

API

The full API is exposed via the TagController and Metadata classes. Refer to the TypeScript definitions in index.d.ts for a complete list of available methods and properties.

Contributing

Interested in contributing? Please refer to the main README.md at the root of the repository for setup, build, and testing instructions.