1.6.4 • Published 9 months ago

pkmonjs v1.6.4

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

PkmonJs

Build Status npm npm

A package to use the PokeApi

Author

Installation

Install pkmonjs with NPM

  npm install pkmonjs

or Yarn

  yarn add pkmonjs

Demonstration

Enter a pokemon name will receive an object as a response

JavaScript

    const {getPokemon,getAllPokemon,getAllPokemonNames} = require('pkmonjs')

    const poke = getPokemon('pikachu').then((f)=>
     {
        if(f) {
          console.log(f)
        }
     }
    )
    //or use await
    const poke =await getPokemon('pikachu')

    const names=await getAllPokemonNames()

    const pokes=await getAllPokemonNames()

TypeScript

    import {
      getPokemon,
      getAllPokemon,
      getAllPokemonNames,
      Pokemon,
      PokemonNamesArray,
      PokemonArray }
    from 'pkmonjs';

    const poke:Pokemon = getPokemon('pikachu').then((f)=>
     {
        if(f) {
          console.log(f)
        }
     }
    )
    //or use await
    const poke:Pokemon =await getPokemon('pikachu')

    const names:PokemonNamesArray=await getAllPokemonNames()

    const pokes:PokemonArray=await getAllPokemonNames()

Response Exemple

    Pokemon{
        idPokedex: 1,
        name: 'bulbasaur',
        description: 'While it is young, it uses the nutrients that are stored in the seed on its back in order to grow.',
        sexMalePorcentage: 85,
        sexFemalePorcentage: 15,
        undefinedPorcentage: 0,
        stats: {
          hp: 45,
          attack: 49,
          defense: 49,
          specialAttack: 65,
          specialDefense: 65,
          speed: 45,
          height: 7,
          weight: 69,
          types: {
            name: [Array],
            weakness: [Object]
            }
        },
        image: {
          default: 'https://assets.pokemon.com/assets/cms2/img/pokedex/full/001.png',
            UrlMaleOrUndefined: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png',
            UrlShiny: 'https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/1.png'
        },
        color: {
          name: 'green',
          url: 'https://pokeapi.co/api/v2/pokemon-color/5/'
          },
        habitat: {
          name: 'grassland',
          url: 'https://pokeapi.co/api/v2/pokemon-habitat/3/'
        },
        generation: {
          name: 'generation-i',
          url: 'https://pokeapi.co/api/v2/generation/1/'
        }
}

  Names{
      { "idPokedex": 1, "pokemonName": "bulbasaur" },
      { "idPokedex": 2, "pokemonName": "ivysaur" },
      { "idPokedex": 3, "pokemonName": "venusaur" },
      { "idPokedex": 4, "pokemonName": "charmander" },
      ...
  }

  Pokemons{
    Pokemon,
    Pokemon,
    Pokemon
    ...
  }
1.6.4

9 months ago

1.6.3

9 months ago

1.6.2

9 months ago

1.6.1

9 months ago

1.6.0

9 months ago

1.4.0

9 months ago

1.5.5

9 months ago

1.5.4

9 months ago

1.5.3

9 months ago

1.5.2

9 months ago

1.5.1

9 months ago

1.5.0

9 months ago

1.3.2

9 months ago

1.3.1

9 months ago

1.2.12

2 years ago

1.2.13

2 years ago

1.2.16

2 years ago

1.2.17

2 years ago

1.2.14

2 years ago

1.2.15

2 years ago

1.2.18

2 years ago

1.3.0

2 years ago

1.2.11

2 years ago

1.2.10

2 years ago

1.2.9

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.16

2 years ago

1.1.15

2 years ago

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago