Narcoleptic's Patch Mangler
    Wondering what’s next for npm?Check out our public roadmap! »

    media-library

    1.2.4 • Public • Published

    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

    Install

    npm i media-library

    DownloadsWeekly Downloads

    5

    Version

    1.2.4

    License

    ISC

    Last publish

    Collaborators

    • avatar