3.2.1 • Published 5 months ago

pokemon v3.2.1

Weekly downloads
694
License
MIT
Repository
github
Last release
5 months ago

pokemon

Get Pokémon names

The name list is just a JSON file and can be used wherever.

npm.io

Install

npm install pokemon

Usage

const pokemon = require('pokemon');

pokemon.all();
//=> ['Bulbasaur', …]

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

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

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

API

.all(language?)

Get all Pokémon names as a string[].

language

Type: string\ Default: 'en'

Language code to retrieve the list of Pokémon for.

pokemon.all();
//=> ['Bulbasaur', …]
pokemon.all('de');
//=> ['Bisasam', …]

.random(language?)

Get random Pokémon name.

language

Type: string\ Default: 'en'

Language code to retrieve the Pokémon for.

pokemon.random();
//=> 'Vigoroth'
pokemon.random('de');
//=> 'Muntier'

.getName(id, language?)

Get Pokémon name from ID.

id

Type: number

The ID of a Pokémon, retrieved via getId().

language

Type: string\ Default: 'en'

Language code to retrieve the Pokémon for.

pokemon.getName(100);
//=> 'Voltorb'
pokemon.getName(100, 'de');
//=> 'Voltobal'

.getId(name, language?)

Get Pokémon ID from name.

name

Type: string

The Pokémon name in the language locale.

language

Type: string\ Default: 'en'

Language code of the localized name.

pokemon.getId('Snorlax');
//=> 143
pokemon.getId('Relaxo', 'de');
//=> 143

.languages: Set

pokemon.languages.has('ja');
//=> true

Supported languages

Pokémon names are available for the following languages:

  • de (German)
  • en (English)
  • fr (French)
  • es (Spanish)
  • ja (Japanese)
  • ko (Korean)
  • ru (Russian)
  • th (Thai)
  • zh-Hans (Simplified Chinese)
  • zh-Hant (Traditional Chinese)

The language codes follow the IETF BCP 47 standard.

Related

Known Issues

  • ru (Russian) - Does not include Pokemon 1009-1025 (Future Paradox Pokemon, and Pokemon released in Gen 9 Expansions - The Teal Mask, and The Indigo Disk). Cannot find credible source for translation.
3.2.1

5 months ago

3.2.0

6 months ago

3.1.0

9 months ago

3.0.0

10 months ago

2.3.6

1 year ago

2.3.5

2 years ago

2.3.4

2 years ago

2.3.2

3 years ago

2.3.3

3 years ago

2.3.1

3 years ago

2.3.0

3 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

6 years ago

1.2.3

6 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.7.0

8 years ago

0.6.0

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.1

10 years ago