1.0.2 • Published 8 years ago
nrdb v1.0.2
nrdb
NPM module for asynchronously querying the public endpoints of the NetrunnerDB API.
Installation
npm install --save nrdb
// OR
yarn add nrdbExample usage
var nrdb = require('nrdb')
// Print all cards on the latest MWL.
nrdb.mwl()
.then(data => {
let cards = data[data.length-1].cards
for(let each in cards) {
nrdb.card(each)
.then((data) => {
let card = data[0]
let mwlstars = (cards[each] === 3) ? "***" : "*"
console.log(`${card.title} ${mwlstars}`)
})
}
})Implemented routes
See docs for each of those in the NRDB API documentation
card(id)cardscycle(code)cyclesdecklist(id)decklistByDate(date)(dateis either a date string formatted withYYYY-MM-DDor a Date object)faction(code)factionsmwlpack(code)packsprebuiltsside(code)sidestype(code)types