Pokémon JSON dataset for SuperEffective.gg based on Showdown's data.
It also includes a JavaScript HTTP client, data types and Zod schema validators.
npm install @supeffective/dataset
# or
yarn add @supeffective/dataset
# or
pnpm add @supeffective/dataset
# or
bun add @supeffective/dataset
This project includes a development server, to serve the data
folder as a JSON API.
Optionally, it can also serve a directory of assets, such as
images (e.g ../supereffective-assets/assets
).
You can configure the server using the environment variables
from the .env.example
file.
To start the server, run pnpm dev
, which will also rebuild
the JS dist files whenever you change the TS files.
Here's a quick guide on how to add new data to the dataset for each data type.
When you are finished, run pnpm build
to rebuild the generated and the JS dist files.
The -index.json
data files will be rebuilt automatically, using the data from the individual JSON files.
- Add the Pokémon to
data/pokemon-index.json
(theid
andregion
are enough) - Add the Pokémon JSON to
data/pokemon/{region}/{pokemonId}.json
(replace{region}
and{pokemonId}
with the actual values) - You can use any other as a template:
data/pokemon/kanto/bulbasaur.json
- For that you need to generate it in the assets project first http://github.com/supeffective/assets
- Repository: http://github.com/supeffective/dataset
- API Reference: https://www.jsdocs.io/package/@supeffective/dataset
- Make sure the dist files are always less than 2MB. If they are bigger, frameworks like Next.js will have trouble
caching the requests when using
fetch
.