It can parse both ID3v1 and ID3v2 tags within a browser or within Node.
Files can be read from the local disk (Node only), same-origin URLs
File instances (HTML5 File API).
$ npm i -S id3js
You may parse ID3 tags of a remote MP3 by URL:
This works by sending a
HEAD request for the file and, based on the response,
Range requests for the ID3 tags.
This is rather efficient as there is no need for the entire file to be downloaded.
You may parse ID3 tags of a local file in Node:
Keep in mind, Node must be run with
for this to be imported and it cannot be used with
File inputs (HTML5)
You may parse ID3 tags of a file input:
This will read the data from the File instance using slices, so the entire file is not loaded into memory but rather only the tags.
An MP3 may have images embedded in the ID3 tags. If this is the case,
they can be accessed through the
tag.images property and will
look like so:
As you can see, the data is provided as an
To access it, you may use a
DataView or typed array such