2.4.3 • Published 7 months ago

fast-poke-fetch v2.4.3

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

Pokémon API Client

npm version

This is a simple Node.js client for fetching data from the PokéAPI. It provides functions to retrieve information about Pokémon, moves, and items. Additionally, it includes caching functionality to improve performance and reduce the number of API requests.

Installation

To use this Pokémon API client, you can install it using npm:

`npm install fast-poke-fetch`

Usage

Import the module

const { Pokemon, PokeItem, PokeMove } = require('fast-poke-fetch');

Fetch Pokemon Data

const pikachuData = await  Pokemon('pikachu'); console.log(pikachuData);

Example Return

{  "id":  25,  "name":  "pikachu",  "height":  4,  "weight":  60,  "types":  ["electric"],  "abilities":  ["static",  "lightning-rod"],  "sprites":  {  "front_shiny":  "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/25.png"  }  }

Fetch Item Data

const potionData = await  PokeItem('potion'); console.log(potionData);

Example Return

{  "id":  1,  "name":  "potion",  "effect_entries":  [  {  "effect":  "Heals a Pokémon by 20 HP.",  "short_effect":  "Heals by 20 HP."  }  ],  "sprites":  {  "front_shiny":  "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/items/shiny/1.png"  }  }

Fetch Move Data

const tackleData = await  PokeMove('tackle'); console.log(tackleData);

Example Return

{  "id":  33,  "name":  "tackle",  "pp":  35,  "effect_entries":  [  {  "effect":  "Inflicts regular damage with no additional effects.",  "short_effect":  "Inflicts damage."  }  ]  }

Caching Data

This client uses caching to reduce the number of API requests and speed up return time. Cached data is stored for a default of 900 seconds (15 minutes). It is periodically checked every 300 seconds for stale data. You can configure the caching settings by modifying the cache object in the code.

2.3.0

8 months ago

2.2.1

8 months ago

2.1.2

8 months ago

2.2.0

8 months ago

2.4.1

7 months ago

2.3.2

8 months ago

2.2.3

8 months ago

2.4.0

7 months ago

2.3.1

8 months ago

2.2.2

8 months ago

2.4.3

7 months ago

2.3.4

8 months ago

2.2.5

8 months ago

2.4.2

7 months ago

2.3.3

8 months ago

2.2.4

8 months ago

2.3.5

7 months ago

2.1.0

8 months ago

2.0.3

8 months ago

2.0.2

8 months ago

2.0.1

8 months ago

2.0.0

8 months ago

1.0.0

9 months ago

0.8.3

9 months ago

0.8.2

9 months ago

0.8.1

9 months ago

0.8.0

9 months ago