TypeScript-based client for the Last.fm API 2.0, designed to streamline access to its public methods and JSON responses.
- 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).
# via yarn
yarn add @imikailoby/lastfm-ts
# via npm
npm install @imikailoby/lastfm-ts
- 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'); // Insert your API key
lastFm.user.getInfo({ user: 'imikailoby' }).then((response) => {
const { user } = response;
// Do something with user data
});
For comprehensive documentation, including detailed parameter descriptions, usage examples, FAQs, and more, please refer to the repository wiki.