1.0.5 • Published 9 years ago
cover-art v1.0.5
cover-art
Forked from lacymorrow/album-art
I made no changes (except for changing the module name), it's just that there were some changes I needed from it that were in the Github repo but not in the npm package.
Get an album or artist image url in node: "The Beatles" ➔ http://path/to/beatles.jpg
Install
$ npm install --save cover-art
Usage
var coverArt = require('cover-art');
coverArt('The Beatles', function (err, url) {
console.log(url);
//=> http://path/to/beatles.jpg
});
coverArt('The Beatles', 'Abbey Road', 'large', function (err, url) {
console.log(url);
//=> http://path/to/beatles/abbey_road_large.jpg
});
API
coverArt(artist , album , callback)
artist
Required
Type: string
Artist to search for.
album
Type: string
Album to search for.
size
Type: string
possible values: small
, medium
, large
, extralarge
, mega
Size of image to return.
callback(err, url)
Required
CLI
You can also use it as a CLI app by installing it globally:
$ npm install --global cover-art
Usage
$ cover-art --help
Usage
$ cover-art artist [album] [small|medium|large|extralarge|mega]
Example
$ cover-art 'The Beatles' 'Abbey Road' large
http://path/to/beatles/abbey_road_large.jpg
License
This package uses the Last.fm API for it's data. You may consult the Last.fm API Terms of Service for license details.