Skip to content

Module for Node.js to detect currently playing music on your operating system. Created nicley for iLyrics

Notifications You must be signed in to change notification settings

Mondonno/ilyrics-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ILyrics Core

NPM

Ilyrics core is the module to check the current playing music on the user computer via the system preffered scripts. The usage of this is for example, if you need the acces and providing the types for the current playing music. This package is created for iLyrics project wich helps you to find the lyrics for the current playing song.

Usage

Process of downloading data is very easy as shown below.

Currently the options in the ilyrics class are unavaible

const { iLyricsLib } = require("ilyrics-core");
const ilCore = new iLyricsLib({
    lyrics: false, // if marked as true downloading the lyrics for song on the check (soon will be deprecated)
    players: ['QUICK', 'ITUNES', 'SPOTIFY'], // check only selected players (if null checking all players)
    system: null, // leave blank if you does not want to force the execution system
    reapeatLock: false // true if you want to does not leak resources on the againist checks (useful in interval)
});

(async () => {
    const data;
    try {
        data = await ilCore.checkMusic();
    }catch(e) {
        console.error(e);
    }

    if(data){ 
        return console.log(data.details.name); // logging music name
    }
})

Supported Players

The supported players are only 3 and only on MacOS but working to support more platforms (linux and win32, win64) Players are sorted by the data pioritity.

  • iTunes (1)
  • Spotify (2)
  • Quick Time Player (3)

Todo

  • Add support for Windows and Linux platforms
  • Add support for the iLyricsLib options