4.4.6 • Published 6 months ago

genius-lyrics-axios v4.4.6

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

This is a fork of node-genius-lyrics to use Axios instead of Undici for HTTP. I made this fork because I'm using this library in a MeteorJS 2.x application that can't use Undici due to its usage of WASM (archived threads in combination with wasm not supported), something that may be fixed by the future release of MeteorJS 3.x

npm npm npm Documentation

🤔 Whats is this?

Just a simple lyrics fetcher that uses Genius. This also has official API implementations.

💻 Installation

npm install genius-lyrics-axios

⚙️ Usage

const Genius = require("genius-lyrics-axios");
const Client = new Genius.Client("top-secret-optional-key");

📎 Links

✏️ Examples

Requiring

JavaScript

const Genius = require("genius-lyrics-axios");
const Client = new Genius.Client("top-secret-optional-key"); // Scrapes if no key is provided

TypeScript

import Genius from "genius-lyrics-axios";
const Client = new Genius.Client("top-secret-optional-key"); // Scrapes if no key is provided

Fetching a Song and Lyrics

const searches = await Client.songs.search("faded");

// Pick first one
const firstSong = searches[0];
console.log("About the Song:\n", firstSong, "\n");

// Ok lets get the lyrics
const lyrics = await firstSong.lyrics();
console.log("Lyrics of the Song:\n", lyrics, "\n");

Fetching an Artist

const artist = await Client.artists.get(456537);
console.log("About the Artist:\n", artist, "\n");