Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@musicorum/lastfm

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@musicorum/lastfm

Fully typed [Last.fm](https://last.fm) api client library written and made for Typescript!

  • 0.0.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

@musicorum/lastfm

Fully typed Last.fm api client library written and made for Typescript!

Warning This library is still in alpha and on heavy development. Expect incomplete stuff and future changes.

Basic usage

import LastClient from '@musicorum/lastfm'

const client = new LastClient('e8077692fe0485f6b474fdab331793c')

async function main() {
  // Original response from API (with types)
  const user1 = await client.request('user.getInfo', { user: 'metye' })

  // Formated response for better experience
  const user2 = await client.user.getInfo('metye')

  console.log(
    user1.user.playcount,
    user2.playCount
  )

  const recentTracks = await client.user.getRecentTracksPaginated('metye')
  console.log(`${recentTracks.totalResults} results in ${recentTracks.totalPages} pages`)

  const page1 = recentTracks.getPage(1)
  const page2 = await recentTracks.fetchPage(2)

  console.log('Last scrobble:', page1[0].name, page1[0].nowPlaying ? ' - Now playing' : '')
}
main()

Keywords

FAQs

Package last updated on 01 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc