JSPM

  • Created
  • Published
  • Downloads 5630
  • Score
    100M100P100Q119688F

Music metadata library for node, using pure Javascript.

Package Exports

  • musicmetadata

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (musicmetadata) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Installation

Install via npm:

npm install musicmetadata

API

var fs = require('fs');
var musicmetadata = require('musicmetadata');

//create a new parser from a node ReadStream
var parser = new musicmetadata(fs.createReadStream('sample.mp3'));

//listen for the metadata event
parser.on('metadata', function(result) {
    console.log(result);
});

//start the parser
parser.parse();

This will output the standard music metadata:

{ artist: 'Spor',
  album: 'Nightlife, Vol 5.',
  albumartist: 'Andy C',
  title: 'Stronger',
  year: 2010,
  track: [1,44],
  disk: [1,2] }
  

If you just want the artist - listen for the artist event:

parser.on('artist', function(result) {
    console.log(result);
});