# fast-poke-fetch

> a fast pokemon api wrapper

Latest version **2.4.3** (published 2023-09-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install fast-poke-fetch
pnpm add fast-poke-fetch
yarn add fast-poke-fetch
bun add fast-poke-fetch
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.4.3 |
| Published | 2023-09-30 |
| First published | 2023-08-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 29.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | eg-school |

## Links

- npm: https://www.npmjs.com/package/fast-poke-fetch
- npm.io page: https://npm.io/package/fast-poke-fetch

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^1.4.0
- [node-cache](https://npm.io/package/node-cache.md) ^5.1.2

## Recent versions

- 2.4.3 (latest) — 2023-09-30
- 2.4.2 — 2023-09-27
- 2.4.1 — 2023-09-27
- 2.4.0 — 2023-09-27
- 2.3.5 — 2023-09-27
- 2.3.4 — 2023-09-25
- 2.3.3 — 2023-09-25
- 2.3.2 — 2023-09-25
- 2.3.1 — 2023-09-18
- 2.3.0 — 2023-09-18
- 2.2.5 — 2023-09-18
- 2.2.4 — 2023-09-18
- 2.2.3 — 2023-09-13
- 2.2.2 — 2023-09-13
- 2.2.1 — 2023-09-11
- … 12 more at https://npm.io/package/fast-poke-fetch/versions

## README

# Pokémon API Client
[![npm version](https://img.shields.io/npm/v/fast-poke-fetch.svg)](https://www.npmjs.com/package/fast-poke-fetch)

This is a simple Node.js client for fetching data from the [PokéAPI](https://pokeapi.co/). 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:
```bash
`npm install fast-poke-fetch`
```

## Usage

### Import the module
```javascript
const { Pokemon, PokeItem, PokeMove } = require('fast-poke-fetch');
```

### Fetch Pokemon Data
```javascript
const pikachuData = await  Pokemon('pikachu'); console.log(pikachuData);
```
Example Return
```javascript
{  "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
```javascript
const potionData = await  PokeItem('potion'); console.log(potionData);
```
Example Return
```javascript
{  "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
```javascript
const tackleData = await  PokeMove('tackle'); console.log(tackleData);
```
Example Return
```javascript
{  "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.

---
_Source: https://npm.io/package/fast-poke-fetch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
