Socket
Socket
Sign inDemoInstall

pokemon

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pokemon

Get Pokémon names


Version published
Weekly downloads
6.5K
increased by0.84%
Maintainers
1
Weekly downloads
 
Created
Source

pokemon

Get Pokémon names

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

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.

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.

Keywords

FAQs

Package last updated on 24 Jul 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc