pokenode-ts

A lightweight Node.js wrapper for the PokéAPI with built-in types.

Usage no npm install needed!

<script type="module">
  import pokenodeTs from 'https://cdn.skypack.dev/pokenode-ts';
</script>

README

pokenode-ts

Build Codecov Snyk NPM Downloads

What it is

A lightweight Node.js wrapper for the PokéAPI with built-in types. An easy way to integrate your app with the PokéAPI.

Features

Installation

npm i pokenode-ts
# or
yarn add pokenode-ts # Recommended

Basic Example

Using a client, like PokemonClient:

import { PokemonClient } from 'pokenode-ts';

(async () => {
  const api = new PokemonClient();

  await api
    .getPokemonByName('luxray')
    .then((data) => console.log(data.name)) // will output "Luxray"
    .catch((error) => console.error(error));
})();

Or, using the MainClient:

import { MainClient } from 'pokenode-ts';

(async () => {
  const api = new MainClient();

  await api.pokemon
    .getPokemonByName('luxray')
    .then((data) => console.log(data.name)) // will output "Luxray"
    .catch((error) => console.error(error));
})();

Documentation

Check out our Documentation page!

Insomnia Collection

If you want to test the PokéAPI endpoints, we recommend using Insomnia:

Open in VS Code

Open Pokenode-ts in your Code, either using the Remote Repositories extension, or cloning in a Dev Container:

Open in VS Code

Leave your feedback

Donate

Please consider donating if you think pokenode-ts is helpful to you or that my work is valuable. I am happy if you can buy me a coffee ❤️

bmc-button  kofi-button  paypal-button

Repository Analytics

Analytics