Socket
Socket
Sign inDemoInstall

media-library

Package Overview
Dependencies
110
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    media-library

a media library (indexer and search/browse api)


Version published
Weekly downloads
22
decreased by-12%
Maintainers
1
Install size
4.82 MB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 05 Jan 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc