1.0.4 • Published 3 years ago

beatsaver v1.0.4

Weekly downloads
7
License
GNU General Publi...
Repository
github
Last release
3 years ago

https://github.com/SpikeHD/node-beatsaver https://github.com/SpikeHD/node-beatsaver https://www.npmjs.com/package/node-beatsaver

node-beatsaver

A function-based API wrapper for https://beatsaver.com

https://www.npmjs.com/package/beatsaver

Installation

Run npm install beatsaver and require it in your project like so:

const bs = require('beatsaver')

Usage

All functions are async unless listed otherwise.

Jump to:

Functions

find(query)

Find maps by searching with a query.

ParameterType
queryString

getbyHash(hash)

Get maps details by hash string.

ParameterType
hashString

getByKey(key)

Get map details by it's key

ParameterType
keyString

getMaps(opts)

Find maps by sort method.

ParameterType
optsObject

Using the opts object

KeyDescriptionOptional?
sortMethod to sort byYes - defaults to 'hot'
pagePage to getYes - defaults to 1

Available sort methods

  • uploader (include id param in your options)
  • hot
  • rating
  • latest
  • downloads
  • plays

Examples

Finding maps

const maps = await bs.find('t+pazolite')

Getting a map by hash

const maps = await bs.getByHash('7f344bbf7ec69b67bd3bc9f03bae39d0b3789120')

Getting a map by key

const maps = await bs.getByKey('105a9')

Getting maps by sorting method

Available sort methods:

  • uploader (include id param in your options)
  • hot
  • rating
  • latest
  • downloads
  • plays

Also allows page navigation.

// Hot maps
const byHot = await bs.getMaps({ sort: 'hot' })

// Maps from uploader
const byUploader = await bs.getMaps({ sort: 'uploader', id: '5cff0b7698cc5a672c8544e6' })

// Second page of top rated maps
const byRating = await bs.getMaps({ sort: 'rating', page: 2 })

// Etc...

Contributing

Issues, PRs, etc., are all welcome!

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago