Package Exports
- media-library
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 (media-library) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Installation
$ npm install media-library
Usage
var MediaLibary = require('media-library')
var library = new MediaLibrary({
// persistent storage location (optional)
databasePath: './'
// the paths to scan
paths: [ 'C:\\data\\music', 'C:\\Users\\me\\music' ]
});
// Scanning files (only needed at first start and when paths are added)
library.scan()
.then(function() {
// listing all tracks
library.tracks()
.then(function(tracks) {
console.log(tracks);
});
// listing artists
library.artists()
.then(function(tracks) {
console.log(tracks);
});
// searching tracks
library.find({ artist: 'radiohead', title: 'ok' })
.then(function(tracks) {
console.log(tracks);
});
});
todo
Compilations
Could auto detect by AlbumArtist and/or heuristic + manual setting