sindresorhus / pokemon Goto Github PK
View Code? Open in Web Editor NEWGet Pokémon names
License: MIT License
Get Pokémon names
License: MIT License
"Blipbug",
"Dottler",
"Orbeetle",
"Rookidee",
"Corvisquire",
"Corviknight",
"Skwovet",
"Greedent",
Line 877 in 25b691c
Line 877 contains "À", which is not part of Indeedee's Simplified Chinese name.
Line 670 in 6bf48a3
It's necessary the Spanish language because some pokémon have a different name as Type: Null that is called "Código Cero" in Spanish
Cheers!
If getLocalizedList was exported, you could for instance list out every pokemon. It would be a better solution than require("pokemon/data/en.json")
(not even sure if that works)
I would open a pull request, but I wanted to see if this was a good idea first.
Fun package!
Suggestion for an enhancement:
Do you think it would be beneficial to have explicit named functions for the above functionality? It would be something simple like (but maybe with better names):
function getByNumber(pokedexNumber = 0) {
return pokemon[pokedexNumber - 1];
}
function getNumber(name = '') {
const pokedexNumber = pokemon.indexOf(name);
return pokedexNumber === -1 ? pokedexNumber : pokedexNumber + 1;
}
exports.getByNumber = getByNumber;
exports.getNumber = getNumber;
Just installed this via yarn/npm in my Vue JS project, but it couldn't compile due to the pokemon package not being able to import /data/en.json.
I fixed it by just changing index.js line 3:
const pokemon = require('./data/en.json');
It uses some of ES2015 features, like template strings or arrow functions.
When trying to build a create-react-app it fails with the following error:
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/pokemon/index.js:6
Read more here: http://bit.ly/2tRViJ9
It would be nice to publish an ES5 version to npm.
why we have a function called getName but we need to pass the id?
For me getName we need to pass the name of pokemon we want.
Example of the function finding by name
exports.getName = (pokemonName, language = 'en') => {
const list = getLocalizedList(language);
const name = list.find(pokemon => pokemon === pokemonName);
if (!name) {
throw new Error(`Pokémon with name '${pokemonName}' does not exist. ${reportText}`);
}
return name;
};
Hi team,
It seems that the long list of Pokemon in /data
does not contain any regional forms i.e. Alolan forms and Galarian forms. For example, there should be both Ninetales and Alolan-Ninetales, but it seems that only the former exists in the list. The same applies for all the regional variants.
Could these be added?
This wonderful package might be used in some cases like this:
import pokemon from 'pokemon'
const snorlax = pokemon.get(143)
console.log(snorlax.ability, snorlax.type)
If you want, I'm glad to PR for this work.
The following new Pokémon need to be added:
803 Poipole
804 Nagandel
805 Stakataka
806 Blacephalon
807 Zeraora
808 Meltan
809 Melmetal
I think it might be cleaner if we moved the json files in a subdirectory.
pokemon
|- en.json
|- fr.json
|- ...
Hello,
I do not really know what is the reference for french name.
Mr. Mime (122) in "french pokemon go" is : M. Mime and not Mime.
for pokemon "Type: Null" (772) will it be Type: 0 or Type: Zero ?
I think this is an invalid pokemon name.
"Type: Null"
https://github.com/sindresorhus/pokemon/blob/master/data/en.json#L773
Line 707 in e7001d9
Hi, is it planned to update this repo with Gen 9? Thanks in advance
I created a list of ids of rare pokemon based on their names. I had some typos and the package only throws an error indicating that a pokemon with that name does not exist. It would be nice if it showed Pokemom with name ${name} does not exist
instead.
Last october the 8th generation of Pokemon in the form of Pokémon Sword and Pokémon Shield released on the Nintendo Switch. I notice that you're missing all of their names.
I can make a PR for this when I got some more time if you'd like.
Offer a little improvements for the function getName. Second argument is optional, and return object with name on all langs.
And something similar to getId function. Looking for a name of all dictionaries, if the second argument is not specified.
What do you think about it?
Would it be possible to add support for Pokemon with multiple forms?
For example, have something like Vulpix-alola or Ponyta-galar? And maybe even support for Pokemon that can change their types with held items, i.e. Arceus and Silvally?
I'd be happy to make the additions if this is approved.
Uhhh, torchic isnt a valid pokemon when getting base stats
When passing name in getId function, if I pass pikachu
it doesn't work but if I pass Pikachu
I get it
So, is there a way to make both the name to lowercase or bring the first letter to UPPERCASE and check with index
function?
I found this stackoverflow answer useful: https://stackoverflow.com/a/4878800
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.