Socket
Socket
Sign inDemoInstall

genius-lyrics-fetcher

Package Overview
Dependencies
16
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    genius-lyrics-fetcher

simple package that fetches song lyrics from the Genius API


Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Install size
2.84 MB
Created
Weekly downloads
 

Readme

Source

genius-lyrics-fetcher

A simple node.js client that fetches song lyrics from the Genius API!

Installation

npm install --save genius-lyrics-fetcher

Example usage

Retrieve an access token from Genius: https://genius.com/developers

Import and initialize client

import GeniusFetcher from 'genius-lyrics-fetcher';

const ACCESS_TOKEN = 'YOUR TOKEN HERE';
const client = new GeniusFetcher.Client(ACCESS_TOKEN);

Async / await usage

async function getLyrics() {
  const result = await client.fetch("San Francisco Street", "Sun Rai");
  return result.lyrics;
}
async function getArtist() {
  return await client.fetchArtist("Tame Impala");
}

.then() usage

client.fetch("Nanã", "Polo & Pan")
  .then(result => console.log(result.lyrics));

Methods

fetch(trackTitle, artistName)

Returns a Promise resolving to an object { songImg, songImgSm, artistImg, url, artistName, trackTitle, lyrics } for trackTitle by artistName. If the track is not found, an Error will be thrown.

fetchArtist(artistName)

Returns a Promise resolving to an object { artistImg, url, artistName } for artistName. If the artist is not found, an Error will be thrown.

Keywords

FAQs

Last updated on 22 Nov 2020

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