Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

genius-lyrics-fetcher

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

genius-lyrics-fetcher

simple package that fetches song lyrics from the Genius API

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 22 Nov 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc