Options
All
  • Public
  • Public/Protected
  • All
Menu

Class for

  • reading ID3v2
  • writing ID3v2
  • removing ID3v2

Basic usage example:

import {ID3v2} from 'jamp3';

async function run(): Promise<void> {
const id3v2 = new ID3v2();
const filename = 'demo.mp3';
const tag = await id3v2.read(filename);
if (tag) {
console.log('id3v2:', tag);
console.log(ID3v2.simplify(tag)); // combine frames into one simple tag object
} else {
console.log('id3v2: None found');
}
}

run().catch(e => {
console.error(e);
});

Hierarchy

  • ID3v2

Index

Constructors

Methods

  • read(filename: string): Promise<undefined | IID3V2.Tag>
  • Reads a filename & returns ID3v2 tag as Object

    Parameters

    • filename: string

      the file to read

    Returns Promise<undefined | IID3V2.Tag>

    a object returning i3v2 tag if found

  • readRaw(filename: string): Promise<undefined | Buffer>
  • Reads a filename & returns ID3v2 tag as Buffer

    Parameters

    • filename: string

      the file to read

    Returns Promise<undefined | Buffer>

    a object returning i3v2 tag if any found

  • readStream(stream: Readable): Promise<undefined | IID3V2.Tag>
  • Reads a stream & returns ID3v2 tag as Object

    Parameters

    • stream: Readable

      the stream to read (NodeJS.stream.Readable)

    Returns Promise<undefined | IID3V2.Tag>

    a object returning i3v2 tag if found

  • Removes ID3v2 Tag from a file with given options

    Parameters

    Returns Promise<boolean>

    true if tag has been found and removed

  • Writes ID3v2 Tag from an ID3v2 object with given options

    Parameters

    • filename: string

      the file to write

    • tag: ID3v2Tag

      the ID3v2 object to write

    • version: number

      the ID3v2.v version to write

    • rev: number

      the ID3v2.v.r rev version to write

    • options: IID3V2.WriteOptions

      write options

    Returns Promise<void>

  • Checks an ID3v2 Tag for warnings

    Parameters

    • tag: IID3V2.Tag

      the ID3v2 object to simplify

    • Optional dropIDsList: string[]

      a list of frame IDs to ignore, eg. 'APIC'

    Returns TagSimplified

    a simplified ID3v2 object

Generated using TypeDoc