Pokenode Ts Save

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

Project README

Pokenode-ts

Pokenode-ts is a lightweight Node.js wrapper for the PokéAPI with built-in types. It provides an easy way to integrate your application with the PokéAPI.

Features

  • 🛠️ Built-in typings: TypeScript support with pre-defined types.
  • 📦 Axios with auto-cache requests: Efficiently manage API requests with automatic caching.
  • 🌲 Logging: Easily log and track your API interactions.

Installation

# NPM
npm install axios axios-cache-interceptor pokenode-ts

# Yarn
yarn add axios axios-cache-interceptor pokenode-ts

# Pnpm
pnpm add axios axios-cache-interceptor pokenode-ts

Basic Example

Using a client, like PokemonClient:

import { PokemonClient } from 'pokenode-ts';

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

  try {
    const pokemonData = await api.getPokemonByName('luxray');
    console.log(pokemonData.name); // Outputs "Luxray"
  } catch (error) {
    console.error(error);
  }
})();

Or, using the MainClient:

import { MainClient } from 'pokenode-ts';

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

  try {
    const pokemonData = await api.pokemon.getPokemonByName('luxray');
    console.log(pokemonData.name); // Outputs "Luxray"
  } catch (error) {
    console.error(error);
  }
})();

Documentation

Check out our Documentation page!

Security

Every change in this project is analyzed by SonarCloud

Quality Gate Status Bugs Code Smells Quality Gate Status codecov

Leave your feedback

If pokenode-ts is valuable to you, please consider buying me a coffee ❤️

Analytics

Open Source Agenda is not affiliated with "Pokenode Ts" Project. README Source: Gabb-c/pokenode-ts
Stars
206
Open Issues
5
Last Commit
3 weeks ago
Repository
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating