@katalonne/billboard-top-100
v1.0.1
Published
Get latest Billboard chart list. For browser and node.
Maintainers
Readme
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-100Usage
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])
| Param | Type | Default | Description | |-------------|-----------------------|--------------|------------------------------------------------------| | [chartName] | string | 'hot-100' | Billboard chart name. ('hot-100' or 'billboard-200') | | [week] | string | current week | chart week. YYYY-MM-DD (Example: '2019-06-01') | | [callback] | Function | | (err, chart) => { ... } |
All parameters are optional, therefore you can pass just the callback.
License
MIT © katalonne
