better-lautfm
v1.2.1
Published
Node wrapper with Typescript definitions for LautFM (much better than the others in this list)
Downloads
4
Maintainers
Readme
Better-LautFM
About
This is a lightweight, object orientated and small wrapper for the public LautFM-API. With following Features:
- types for nearly everything (more will be added soon)
- nearly full station coverage
- coverage for basic lautFM requests (status and so on)
Installation
npm install --save better-lautfm
Documentation
For detailed explanation click here
Basic usage
Usage is currently only optimized for CommonJS, other builds will follow soon.
Example for fetching the whole data of a station
import { Station } from 'better-lautfm'
// dont do this in production
async function topLevelAwait() {
// init station class
const station = new Station('bravefm')
// fetch data
const data = await station.fetch().then(value => value)
console.log(data)
/* the following examples will be inserted here (please take care of imports) */
}
topLevelAwait()
Example for fetching the formatted schedule of a station
const schedule = await station.getSchedule().then(value => value)
console.log(schedule)