# json-pokemon

> Package with pokemons

Latest version **1.0.0** (published 2019-01-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install json-pokemon
pnpm add json-pokemon
yarn add json-pokemon
bun add json-pokemon
```

## 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 | 1.0.0 |
| Published | 2019-01-18 |
| First published | 2019-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 73.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Konstantin Petryaev |
| Maintainers | numminorihsf |
| Keywords | pokemon |

## Links

- npm: https://www.npmjs.com/package/json-pokemon
- Repository: https://github.com/NumminorihSF/json-pokemon
- Homepage: https://github.com/NumminorihSF/json-pokemon#readme
- Issues: https://github.com/NumminorihSF/json-pokemon/issues
- npm.io page: https://npm.io/package/json-pokemon

## Recent versions

- 1.0.0 (latest) — 2019-01-18

## README

# json-pokemon

This package includes list of all pokemons. Original data is available on <https://pokemondb.net/pokedex/national>.

## Install

To install this package use

```bash
npm install --save json-pokemon
```

## Usage

`require` command just returns a list of pokemon objects. The format is next:

```js
const pokemons = require('json-pokemon');

const pokemon = pokemons[0];
// pokemon's structure:
// {
//   id: 1,
//   name: 'some-pokemon-name',
//   typeList: ['Fire', 'Grass']
// }
```

## Possible usage

```js
const getPokemons = require('json-pokemon/getPokemon');

const pokemons = getPokemons(); // See API in the next section.
const firstPokemon = getPokemons.getPokemonById(1); // See API in the next section.
const snow = getPokemons.getPokemonByName('snow'); // See API in the next section.
```

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

-   [Pokemon](#pokemon)
    -   [Properties](#properties)
-   [getPokemonById](#getpokemonbyid)
    -   [Parameters](#parameters)
-   [getPokemonByName](#getpokemonbyname)
    -   [Parameters](#parameters-1)
-   [getPokemon](#getpokemon)
    -   [Parameters](#parameters-2)

### Pokemon

Pokemon's type.

Type: [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

#### Properties

-   `id` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Pokemon's id.
-   `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Pokemon's name.
-   `typeList` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** Pokemon's types.

### getPokemonById

Returns pokemon found by its id.

#### Parameters

-   `id` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Pokemon's id.

Returns **([Pokemon](#pokemon) | null)** Pokemon if founded, else returns null.

### getPokemonByName

Returns pokemon found by its name.

#### Parameters

-   `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Pokemon's id.

Returns **([Pokemon](#pokemon) | null)** Pokemon if founded, else returns null.

### getPokemon

Returns list of pokemons filtered with passed info.

#### Parameters

-   `filter` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Filter descriptor. (optional, default `{}`)
    -   `filter.type` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | null)** Types of pokemons to returns.
        If type is `null`, skip this filter. If type is string, returns list of pokemons which has this type.
        If type is an array, returns list of pokemons which has all of types. (optional, default `null`)

Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[Pokemon](#pokemon)>** List of filtered pokemons.

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