New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

pkmonjs

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pkmonjs

A package for use PokeAPi

latest
Source
npmnpm
Version
1.6.4
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

PkmonJs

Build Status npm npm

A package to use the PokeApi

Author

  • @danielguirra

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
    ...
  }

Keywords

pokemon

FAQs

Package last updated on 15 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts