azul-lyrics
v0.0.2
Published
A package to get lyrics for songs
Downloads
2
Readme
Azul Lyrics
Installation:
npm i azul-lyrics
Usage (without Callback):
const AzulLyrics = require("azul-lyrics");
const lyricsClient = new AzulLyrics(/* My API Key Goes Here*/);
// Search for Never Gonna Give You Up by Rick Astley
const query = {
title: "Never Gonna Give You Up",
artist: "Rick Astley"
}
// By Default, the provider is AUTO
const provider = AzulLyrics.PROVIDERS.AUTO;
// Provide the query and provider (optional)
const result = await lyricsClient.searchForLyrics(query, provider);
if ("error" in result) return console.error(result.error);
console.log("It works: %o", result);
Usage (with Callback)
const AzulLyrics = require("azul-lyrics");
const lyricsClient = new AzulLyrics(/* My API Key Goes Here*/);
// Search for Never Gonna Give You Up by Rick Astley
const query = {
title: "Never Gonna Give You Up",
artist: "Rick Astley"
}
// By Default, the provider is AUTO
const provider = AzulLyrics.PROVIDERS.AUTO;
// Add the 3rd Param: callback (optional)
lyricsClient.searchForLyrics(query, provider, function(result) {
if ("error" in result) {
return console.error(result.error);
};
return console.log("It works: %o", result);
});