JSPM

music-metadata-wasm

0.1.5
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q42603F
  • License MIT

read / write the music file metadata using wasm, powered by lofty-rs

Package Exports

  • music-metadata-wasm
  • music-metadata-wasm/dist/index_bg.js

Readme

music-metadata-wasm

read / write the music file metadata using wasm, powered by lofty-rs

Install

npm install music-metadata-wasm
yarn add music-metadata-wasm
pnpm add music-metadata-wasm

Usage

import { MetaFile } from 'music-metadata-wasm'
import url from '../samples/flac.flac?url'

console.time('total')

const _ = await fetch(url).then(res => res.arrayBuffer())
const buffer = new Uint8Array(_)
const oldMetadata = new MetaFile(buffer)
oldMetadata.title = 'test'

oldMetadata.save()
const newBuffer = oldMetadata.buffer
oldMetadata.dispose()

const data = new MetaFile(newBuffer)
console.log(data.title)
document.querySelector('div')!.innerHTML = data.pictures?.[0].mimeType || 'no cover'

console.timeEnd('total')

Todo

  • Napi 3

License

MIT