-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
120 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,85 @@ | ||
In progress. | ||
# Pokémon TCG SDK | ||
|
||
[](https://discord.gg/dpsTCvg) | ||
|
||
This is the Pokémon TCG SDK SDK Javascript implementation. It is a wrapper around the Pokémon TCG SDK API of [pokemontcg.io](http://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 | ||
|
||
- es6 ([babel](https://babeljs.io)) | ||
- [standardjs](http://standardjs.com) | ||
- [promises](https://www.promisejs.org) | ||
|
||
Build tasks are in npm scripts: | ||
|
||
npm run build | ||
npm run watch | ||
npm run test |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module.exports = { | ||
endpoint: 'https://api.magicthegathering.io/v1' | ||
endpoint: 'https://api.pokemontcg.io/v1' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters