1.0.1 • Published 5 years ago

@katalonne/billboard-top-100 v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Build Status codebeat badge GitHub open issues npm version MIT License

Promise and Callback based module API for getting Billboard chart list For browser and node.js

Installation

yarn add @katalonne/billboard-top-100

npm install --save @katalonne/billboard-top-100

Usage

import getChart from 'billboard-top-100';

// or

const getChart = require('billboard-top-100')

// With Promise
getChart('hot-100').then(chart => {
  console.log(chart)
}).catch(e => {
  console.error(e)
})

// or 

// With a callback
getChart('hot-100', (err, chart) => {
  if (err !== null) {
    console.error(err)
  }

  console.log(chart)
})

getChart(chartName, week, callback)

ParamTypeDefaultDescription
chartNamestring'hot-100'Billboard chart name. ('hot-100' or 'billboard-200')
weekstringcurrent weekchart week. YYYY-MM-DD (Example: '2019-06-01')
callbackFunction(err, chart) => { ... }

All parameters are optional, therefore you can pass just the callback.

License

MIT © katalonne