1.1.0 • Published 9 months ago

album-image v1.1.0

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

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 drukqs

By artist and album name

npx album-image Prodigy "the fat of the land" 

API

npm install album-image

By 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

1.1.0

9 months ago

1.0.7

1 year ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago