1.0.1 • Published 6 years ago

flastm v1.0.1

Weekly downloads
2
License
GPL-2.0
Repository
-
Last release
6 years ago

flastm Build Status Coverage Status

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.