CptSpaceToaster / pokemon-tcg-sdk-javascript

Pokemon TCG SDK - Javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pokémon TCG SDK

pokemontcg-developers on discord npm version Build Status

This is the Pokémon TCG SDK Javascript implementation. It is a wrapper around the Pokémon TCG API of pokemontcg.io.

Installation

npm install --save pokemontcgsdk

Usage

const pokemon = require('pokemontcgsdk')

pokemon.card.find('base1-4')
.then(result => {
    console.log(result.card.name) // "Charizard"
})

Query cards by any property:

card.where({ supertype: 'pokemon', subtype: 'mega' })
.then(cards => {
    console.log(cards[0].name) // "M Sceptile-EX"
})

Retrieve cards across multiple pages of results:

card.all({ name: 'blastoise', pageSize: 1 })
.on('data', card => {
    console.log(card.name)
})

// Will print:
// Blastoise
// Blastoise-EX
// M Blastoise-EX
// ....

Properties

Card

id
name
nationalPokedexNumber
imageUrl
subtype
supertype
ability
ancientTrait
hp
number
artist
rarity
series
set
setCode
retreatCost
text
types
attacks
weaknesses
resistances

Set

code
name
series
totalCards
standardLegal
releaseDate

Development

Build tasks are in npm scripts:

npm run build
npm run watch
npm run test

About

Pokemon TCG SDK - Javascript

License:MIT License


Languages

Language:JavaScript 100.0%