jamp3
    Preparing search index...

    Class ID3v2

    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(console.error);
    Index

    Constructors

    Methods

    • 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

    • Reads a filename & returns ID3v2 tag as Buffer

      Parameters

      • filename: string

        the file to read

      Returns Promise<undefined | Buffer<ArrayBufferLike>>

      a object returning i3v2 tag if any found

    • 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>