Skip to content

Getting started

Installation

Depending on your choice regarding the package manager, you can run one of the following commands to install simple-fm:

Terminal window
# Install simple-fm via npm
npm i @solely/simple-fm

Usage

You’ll need to import the package first.

// Import simple-fm using CommonJS
const SimpleFM = require('@solely/simple-fm');

Below is an example code to quickly fetch recent tracks from a user:

const client = new SimpleFM('Your Last.fm API token goes here');
const data = await client.user.getRecentTracks({ username: 'solelychloe' });
console.log(data);

More examples coming soon!