Skip to content

sumthief/flastm

Repository files navigation

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.

About

Yet another Last.fm JS library

Resources

Stars

Watchers

Forks

Packages

No packages published