flastm
v1.0.1
Published
Promise-based JS API for LastFM
Downloads
3
Readme
flastm
Package for Node.JS which provides Promise based API under Last.fm REST API.
Installation
Install via npm:
npm install --save flastm
Install via yarn:
yarn add flastm
Usage
First of all to use this package you should receive Last.fm API key and secret. You can do it via creation API key.
After that you can use package by this way:
const config = {
api_key: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
secret: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
// Optional: fill only if chosen use auth.getMobileSession method for authorization.
username: 'xxxxxxxx',
password: 'xxxxxxxx'
};
const flastm = require('flastm')(config);
const { album, artist } = flastm;
// Get information about album.
album.getInfo('Breaking Benjamin', 'Phobia')
.then(res => console.log(res));
// Get information about artist.
artist.getInfo('Breaking Benjamin')
.then(res => console.log(res));
List of all packages and methods you can see here.