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

@seemusic/audio-metadata

v0.1.1

Published

Extract audio metadata in the browser (ID3 tags via jsmediatags + duration via AudioContext)

Readme

@seemusic/audio-metadata

从浏览器端音频文件中提取元数据(ID3 标签 + 音频时长),纯浏览器实现,零 Node.js 依赖。

功能

  • MP3:提取标题、表演者、作曲、专辑、流派、歌词、ISRC、封面、时长
  • 其他格式(FLAC/WAV/OGG/M4A):提取时长(通过 AudioContext),标签字段为空
  • 艺人字符串自动拆分("A / B"["A", "B"]

安装

npm install @seemusic/audio-metadata
# or
pnpm add @seemusic/audio-metadata
# or
yarn add @seemusic/audio-metadata

使用

import { extractAudioMetadata, splitPeople } from '@seemusic/audio-metadata';

// 上传音频后提取元数据
const file = inputElement.files[0];
const meta = await extractAudioMetadata(file);

console.log(meta.title);        // "虫儿飞"
console.log(meta.artists);      // ["郑少秋"]
console.log(meta.composers);    // ["陈光荣"]
console.log(meta.cover);        // "data:image/jpeg;base64,..."
console.log(meta.duration);     // 198
console.log(meta.isFallback);   // false(非 MP3 格式时为 true)

// 拆分艺人字符串
const names = splitPeople('周杰伦 / 林俊杰');
// => ["周杰伦", "林俊杰"]

API

extractAudioMetadata(file, options?)

| 参数 | 类型 | 说明 | |---|---|---| | file | File | 音频文件 | | options.skipCover | boolean | 是否跳过封面解析(大文件时节省内存) |

返回 Promise<ExtractedMetadata>,结构:

interface ExtractedMetadata {
  title?: string;
  artists: string[];
  album?: string;
  composers: string[];
  lyricists: string[];
  genres: string[];
  lyrics?: string;
  isrc?: string;
  cover?: string;        // data:image/jpeg;base64,...
  duration?: number;     // 秒
  isFallback?: boolean;  // 非 MP3 格式时为 true
}

splitPeople(value)

| 参数 | 类型 | 说明 | |---|---|---| | value | string \| undefined | 艺人字符串,如 "A / B, C" |

返回 string[],自动按 / , ; , ; 拆分。

技术说明

  • 标签解析:jsmediatags(~15KB gzip)
  • 时长提取:浏览器原生 AudioContext.decodeAudioData
  • 无 Node.js polyfill,Vite/Webpack 开箱即用

License

MIT