@imikailoby/lastfm-ts
TypeScript-based client for the Last.fm API 2.0, designed to streamline access to its public methods and JSON responses.
Key features
- Zero Dependencies: Designed to function independently without any external dependencies.
- Pure Responses: No altered or decorated data from the API. Use API's original responses as you wish.
- Minimal size: ≈1kb minified and gzipped size (Bundlephobia).
Installation
# via yarn
yarn add @imikailoby/lastfm-ts
# via npm
npm install @imikailoby/lastfm-ts
Usage
- Obtain the Last.fm API Key (Read more).
- Initialize the
LastFm
class with the obtained API key. - Use one of the available methods to get the required data.
Example:
import { LastFm } from '@imikailoby/lastfm-ts';
const lastFm = new LastFm('api_key');
lastFm.user.getInfo({ user: 'imikailoby' }).then((response) => {
const { user } = response;
});
Documentation
For comprehensive documentation, including detailed parameter descriptions, usage examples, FAQs, and more, please refer to the repository wiki.