npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pokemontcgsdk

v2.0.0

Published

Pokémon TCG SDK is a javascript wrapper around the Pokémon TCG API located at pokemontcg.io

Downloads

1,383

Readme

Pokémon TCG SDK

Now Supporting Version 2 of the Pokémon TCG API!

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

Configuration

import pokemon from 'pokemontcgsdk'

pokemon.configure({apiKey: '123abc'})

Cards

Get a single card by ID

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

Filter cards via the q parameter

pokemon.card.where({ q: 'name:blastoise' })
.then(result => {
    console.log(result.data[0].name) // "Blastoise"
})

Filter cards via the q parameter and specific page

pokemon.card.where({ q: 'name:blastoise', pageSize: 10, page: 3 })
.then(result => {
    console.log(result.data[0].name) // "Blastoise"
})

Automatically page through card data

pokemon.card.all({ q: 'name:blastoise' })
    .then((cards) => {
        console.log(cards[0].name) // "Blastoise"
    })

Using the all function, pagination happens automatically, and the result will simply contain the data and no pagination info.

Sets

Get a single set by ID

pokemon.set.find('base1')
.then(set => {
    console.log(set.name) // "Base"
})

Filter sets via the q parameter

pokemon.set.where({ q: 'series:base' })
.then(result => {
    console.log(result.data[0].name) // "Base"
})

Filter cards via the q parameter and specific page

pokemon.set.where({ q: 'series:base', pageSize: 1, page: 1 })
.then(result => {
    console.log(result.data[0].name) // "Base"
})

Automatically page through card data

pokemon.set.all({ q: 'series:base' })
    .then((cards) => {
        console.log(cards[0].name) // "Base"
    })

Using the all function, pagination happens automatically, and the result will simply contain the data and no pagination info.

Supertypes

pokemon.supertype.all()

Subtypes

pokemon.subtype.all()

Types

pokemon.type.all()

Rarity

pokemon.rarity.all()

Please refer to https://docs.pokemontcg.io for more information on query syntax and what fields are available.

Development

Build tasks are in npm scripts:

npm run build
npm run test