JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 71
  • Score
    100M100P100Q74356F
  • License ISC

a media library (indexer and search/browse api)

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

Build Status NPM version npm downloads

Installation

$ npm install media-library

Usage

var MediaLibary = require('media-library');
var library = new MediaLibrary({
  // persistent storage location (optional)
  dataPath: './',
  // 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()
.on('track', (track) => {
  console.log(`track: ${track.artist} - ${track.title}`);
})
.on('done', () => {
    // listing all tracks
    library.tracks((err, tracks) => console.log(tracks));

    // listing artists  
    library.artists((err, tracks) => console.log(tracks));

    // searching tracks
    library.find({ artist: 'radiohead', title: 'ok' }, (err, tracks) => {
        console.log(tracks);
    });
});

todo

  • Handle compilations

    Could auto detect by AlbumArtist and/or heuristic + manual setting