1.0.2 • Published 2 years ago
khojo v1.0.2
Khojo
:mag_right: Type-safe last.fm API wrapper
Getting Started
# Yarn
yarn add khojo
# NPM
npm install khojo
Example
import { Client } from "khojo";
const client = new Client(process.env.LASTFM_TOKEN);
(
/* username is mandatory, time limit and the limit of number of artists is optional */
async () => {
// get the top artists of an user
console.log(
await client.getTopArtists("KidnappingNemo", "7day", 5)
);
// get the top albums of an user
console.log(
await client.getTopAlbums("KidnappingNemo", "7day", 5)
)
// get the top songs of an user
console.log(
await client.getTopTracks("KidnappingNemo", "7day", 5)
)
/* username is mandatory, limit is optional but recommended*/
// get the recent tracks listening by a user
console.dir(
await client.getRecentTracks("KidnappingNemo", 1)
)
}();
Why?
There were no good wrappers for the Last.fm API so I made my own :smile:. Also, if you are curious about the name it means search in Hindi
:stop_sign: This library is still under active development. Expect bugs and feel free to open pull requests to fix them 🤝