Skip to content

anshumanv/evolutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

evolutions

A cli tool to get Pokémon evolution chain.

NOTE - Only supports Pokémons upto 6th generation as of now.

Install

To test, install globally:

$ npm install -g evolutions

$ evolutions
torchic combusken blaziken

$ evolutions 1 4
bulbasaur ivysaur venusaur
charmander charmeleon charizard

$ evolutions eevee mudkip
vaporeon jolteon flareon espeon umbreon leafeon glaceon sylveon
mudkip marshtomp swampert

To use in another module:

$ npm install --save evolutions

Usage

const evolutions = require('evolutions');

evolutions.random();
//=> 'Snorlax'

evolutions.getName(147);
//=> 'Dratini'

evolutions.getId('Dratini');
//=> 147

evolutions.exists('Moltres');
//=> true

evolution.getEvolutionChain('chimchar');
//=> chimchar monferno infernape

API

.random(): string

Returns a random pokemon name.

.getName(id: number): string

Get pokemon name form ID.

.getId(name: string): number

Get pokemon ID form name.

.exists(name: string) boolean

Check if the pokemon with a given name exists (not case sensitive).

.getEvolutionChain(name: string): array

Get an array containing the evolution chain of a pokemon.

Related

evolutions-webapp - Webapp to view Pokémon evolution chain.

Author

Anshuman Verma

Contribute

Found a bug, please create an issue

Icons made by Roundicons Freebies from www.flaticon.com is licensed by CC 3.0 BY