https://github.com/intercaetera/nrdb
NPM module for querying the NetrunnerDB api.
https://github.com/intercaetera/nrdb
Last synced: over 1 year ago
JSON representation
NPM module for querying the NetrunnerDB api.
- Host: GitHub
- URL: https://github.com/intercaetera/nrdb
- Owner: intercaetera
- License: mit
- Created: 2017-06-19T14:52:29.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-19T16:30:46.000Z (about 9 years ago)
- Last Synced: 2025-04-11T21:55:44.084Z (over 1 year ago)
- Language: JavaScript
- Size: 21.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nrdb
NPM module for asynchronously querying the public endpoints of the NetrunnerDB API.
[](https://npmjs.org/package/nrdb)
## Installation
```
npm install --save nrdb
// OR
yarn add nrdb
```
## Example usage
```javascript
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](https://netrunnerdb.com/api/doc)
- `card(id)`
- `cards`
- `cycle(code)`
- `cycles`
- `decklist(id)`
- `decklistByDate(date)` (`date` is either a date string formatted with `YYYY-MM-DD` or a Date object)
- `faction(code)`
- `factions`
- `mwl`
- `pack(code)`
- `packs`
- `prebuilts`
- `side(code)`
- `sides`
- `type(code)`
- `types`