album-image
v1.1.0
Published
Retrieve album cover art
Readme
album-image
Look up images from the Musicbrainz/Cover Art Archive via CLI.
Requirements
- Node 18+ (uses native
fetch)
Usage
CLI
By album name alone
npx album-image drukqsBy artist and album name
npx album-image Prodigy "the fat of the land" API
npm install album-imageBy album name alone
import { getAlbumImage } from 'album-image'
const url = await getAlbumImage({ album: 'drukqs' })By artist and album name
import { getAlbumImage } from 'album-image'
const url = await getAlbumImage({ artist: 'Prodigy', album: 'the fat of the land' })Aborting Requests
Requests can be aborted prematurely by using an AbortController:
import { getAlbumImage } from 'album-image'
const ab = new AbortController()
async function run() {
try {
const url = await getAlbumImage({ artist: 'Green Day', album: 'Dookie', signal: ab.signal })
} catch (err) {
// will fail with "AbortError: This operation was aborted"
console.error(err)
}
}
run()
ab.abort()License
MIT
