npm package: @objectifthunes/pokejs-data
Description: Complete Pokémon data library — types, moves, abilities, items, natures, evolutions, stats, damage calc, and more.
Latest version: 1.0.3
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @objectifthunes/pokejs-data

Complete Pokemon data library for TypeScript and JavaScript. All 1,350 Pokemon, 937 moves, 367 abilities, 2,175 items, natures, evolutions, berries, type chart, stat calculator, damage calculator, and more — with dead-simple helper functions.

```
npm install @objectifthunes/pokejs-data
```

## Quick Start

```ts
import { Pokedex, Movedex, TypeChart, Stats, Damage } from "@objectifthunes/pokejs-data";

// Look up any Pokemon
const pikachu = Pokedex.get("pikachu");
pikachu.types;      // ["electric"]
pikachu.baseStats;  // { hp: 35, attack: 55, defense: 40, ... }

// Search by partial name
Pokedex.search("char");  // [charmander, charmeleon, charizard, ...]

// Type effectiveness — works with dual types
TypeChart.effectiveness("fire", "grass");            // 2
TypeChart.effectiveness("fire", ["grass", "steel"]); // 4
TypeChart.effectiveness("ground", "flying");          // 0

// Calculate real stats
const stats = Stats.calcAll(pikachu.baseStats, 50, {
  ivs: Stats.perfectIVs(),
  evs: Stats.competitiveEVs("specialAttack", "speed"),
  nature: "timid",
});

// Damage calculator (Gen V+ formula)
const result = Damage.calc({
  level: 50,
  power: 90,
  attack: stats.specialAttack,
  defense: 100,
  moveType: "electric",
  attackerTypes: ["electric"],
  defenderTypes: ["water"],
  isPhysical: false,
});
result.min;               // minimum damage roll
result.max;               // maximum damage roll
result.effectiveness;     // 2
result.stab;              // true
result.effectivenessLabel // "Super effective"
```

## API Reference

### Pokedex

```ts
Pokedex.get("garchomp")                   // Pokemon | undefined
Pokedex.getById(445)                      // Pokemon | undefined
Pokedex.search("char")                    // Pokemon[]
Pokedex.displayName("mr-mime")            // "Mr. Mime"
Pokedex.byType("dragon")                  // Pokemon[]
Pokedex.baseStatTotal("garchomp")         // 600
Pokedex.bestStat("alakazam")              // { stat: "specialAttack", value: 135 }
Pokedex.worstStat("chansey")             // { stat: "attack", value: 5 }
Pokedex.hasType("charizard", "fire")      // true
Pokedex.isDualType("bulbasaur")           // true (grass/poison)
Pokedex.hasAbility("blaziken", "speed-boost") // true
Pokedex.hiddenAbility("bulbasaur")        // "chlorophyll"
Pokedex.canLearn("pikachu", "thunderbolt") // true
Pokedex.learnset("charmander")            // [{ move: "scratch", level: 1 }, ...]
Pokedex.movesAtLevel("charmander", 20)    // string[] (best 4 moves at that level)
Pokedex.evolutionLine("charmeleon")       // ["charmander", "charmeleon", "charizard"]
Pokedex.evolvesInto("eevee")             // ["vaporeon", "jolteon", "flareon", ...]
Pokedex.evolvesFrom("charmeleon")         // "charmander"
Pokedex.isBaseForm("charmander")          // true
Pokedex.isFinalEvolution("charizard")     // true
Pokedex.evolutionStageCount("charizard")  // 3
Pokedex.species("pikachu")               // Species data (genus, generation, etc.)
Pokedex.starters()                        // all starter Pokemon
Pokedex.random()                          // one random Pokemon
Pokedex.randomTeam(6)                     // 6 random Pokemon (no duplicates)
Pokedex.compare("pikachu", "raichu")      // stat diffs, shared types/moves
Pokedex.count()                           // total Pokemon count
```

### Movedex

```ts
Movedex.get("thunderbolt")               // Move | undefined
Movedex.getById(85)                      // Move | undefined
Movedex.search("thunder")                // Move[]
Movedex.displayName("solar-beam")         // "Solar Beam"
Movedex.byType("fire")                   // Move[]
Movedex.byDamageClass("physical")        // Move[]
Movedex.damagingMoves()                  // all physical + special moves
Movedex.statusMoves()                    // all status moves
Movedex.byAilment("burn")               // moves that can burn
Movedex.priorityMoves()                  // moves with priority > 0
Movedex.multiHitMoves()                  // multi-hit moves
Movedex.isPhysical("earthquake")          // true
Movedex.isSpecial("thunderbolt")          // true
Movedex.isStatus("swords-dance")          // true
Movedex.hasRecoil("brave-bird")           // true
Movedex.isDraining("giga-drain")          // true
Movedex.isHealing("recover")              // true
Movedex.boostsStats("swords-dance")       // true
Movedex.lowersStats("growl")              // true
Movedex.learnedBy("earthquake")           // [{ id, name }, ...] Pokemon that learn it
Movedex.strongest("fire", 5)             // top 5 fire moves by power
Movedex.mostAccurate("fire", 5)          // top 5 fire moves by accuracy
Movedex.random()                         // one random move
Movedex.count()                          // total move count
```

### TypeChart

```ts
TypeChart.get("fire")                             // PokemonType data
TypeChart.effectiveness("fire", "grass")           // 2
TypeChart.effectiveness("fire", ["grass", "steel"]) // 4
TypeChart.isSuperEffective("water", "fire")        // true
TypeChart.isNotVeryEffective("fire", "water")      // true
TypeChart.isImmune("normal", "ghost")              // true
TypeChart.effectivenessLabel("fire", "grass")      // "Super effective"
TypeChart.weaknesses("fire")                       // ["water", "ground", "rock"]
TypeChart.weaknesses(["grass", "poison"])          // dual-type weaknesses
TypeChart.resistances("steel")                     // types steel resists
TypeChart.immunities("ghost")                      // ["normal", "fighting"]
TypeChart.superEffectiveAgainst("fire")            // types fire beats
TypeChart.resistedBy("fire")                       // types that resist fire
TypeChart.blockedBy("normal")                      // ["ghost"]
TypeChart.uncoveredTypes("ice", "ground")          // types neither covers
TypeChart.hasSTAB("fire", ["fire", "flying"])      // true
```

### Stats

```ts
// Single stat (Gen III+ formula)
Stats.calc("hp", 100, 31, 252, 50)       // base 100, 31 IV, 252 EV, level 50
Stats.calc("attack", 130, 31, 252, 100, 1.1)  // with +nature

// All 6 stats at once
Stats.calcAll(pokemon.baseStats, 50, {
  ivs: Stats.perfectIVs(),
  evs: Stats.competitiveEVs("attack", "speed"),
  nature: "jolly",
})

// IV/EV presets
Stats.perfectIVs()                        // { hp: 31, attack: 31, ... }
Stats.zeroIVs()                           // all zeros
Stats.randomIVs()                         // random 0-31 per stat
Stats.emptyEVs()                          // all zeros
Stats.competitiveEVs("attack", "speed")   // 252/252/4 spread

// Utilities
Stats.total(pokemon.baseStats)            // base stat total
Stats.stageMultiplier(2)                  // +2 stages = 2.0x
Stats.stageMultiplier(-1)                 // -1 stage = 0.6667x
Stats.label("specialAttack")             // "Sp. Atk"
Stats.names()                            // all 6 stat names
```

### Damage

```ts
// Full damage calculation (Gen V+ formula)
const result = Damage.calc({
  level: 50,
  power: 100,
  attack: 182,           // attacker's calculated stat
  defense: 100,          // defender's calculated stat
  moveType: "ground",
  attackerTypes: ["dragon", "ground"],
  defenderTypes: ["electric"],
  isPhysical: true,      // optional, default true
  isBurned: false,       // optional, halves physical damage
  extraMultiplier: 1,    // optional, for items/abilities/weather
});
// result = { min, max, effectiveness, stab, effectivenessLabel }

Damage.hitsToKO(200, result.min, result.max)  // { min: 1, max: 2 }
Damage.asPercent(result.min, result.max, 200)  // { min: 85.5, max: 100.5 }
```

### Naturedex

```ts
Naturedex.get("adamant")                  // Nature data
Naturedex.displayName("adamant")          // "Adamant"
Naturedex.summary("adamant")              // "Adamant (+Atk, -Sp.Atk)"
Naturedex.multiplier("adamant", "attack") // 1.1
Naturedex.multiplier("adamant", "specialAttack") // 0.9
Naturedex.isNeutral("hardy")              // true (no stat changes)
Naturedex.find("attack", "specialAttack") // adamant nature
Naturedex.thatBoost("speed")             // natures that boost speed
Naturedex.thatLower("speed")             // natures that lower speed
Naturedex.random()                        // random nature
Naturedex.all()                          // all 25 natures
```

### Itemdex

```ts
Itemdex.get("leftovers")                 // Item | undefined
Itemdex.getById(234)                     // Item | undefined
Itemdex.search("choice")                 // Item[]
Itemdex.displayName("choice-scarf")       // "Choice Scarf"
Itemdex.byCategory("pokeballs")          // Item[]
Itemdex.pokeballs()                      // all Poke Balls
Itemdex.healingItems()                   // all healing items
Itemdex.evolutionItems()                 // all evolution items
Itemdex.tms()                            // all TMs
Itemdex.holdItems()                      // all holdable items
Itemdex.isHoldable("leftovers")           // true
Itemdex.isUsableInBattle("potion")        // true
Itemdex.isConsumable("potion")            // true
Itemdex.count()                          // total item count
```

### Abilitydex

```ts
Abilitydex.get("intimidate")             // Ability | undefined
Abilitydex.getById(22)                   // Ability | undefined
Abilitydex.search("boost")              // Ability[]
Abilitydex.displayName("speed-boost")     // "Speed Boost"
Abilitydex.effect("levitate")            // effect description text
Abilitydex.pokemonWith("levitate")       // [{ id, name, isHidden }, ...]
Abilitydex.count()                       // total ability count
```

### Format

```ts
Format.name("mr-mime")                   // "Mr. Mime"
Format.name("thunder-punch")             // "Thunder Punch"
Format.type("fire")                      // "Fire"
Format.stat("specialAttack")             // "Sp. Atk"
Format.types(["fire", "flying"])         // "Fire / Flying"
Format.stats(pokemon.baseStats)          // formatted stat block
Format.pokemon(pikachu)                  // "#025 Pikachu (Electric) BST 320"
Format.move(thunderbolt)                 // "Thunderbolt — Electric special, 90 power, 100% acc"
Format.height(17)                        // "1.7 m"
Format.weight(905)                       // "90.5 kg"
Format.effectiveness(2)                  // "Super effective"
Format.effectiveness(0)                  // "No effect"
```

### sprites

```ts
import { sprites } from "@objectifthunes/pokejs-data";

sprites.front(25)          // path to Pikachu front sprite
sprites.back(25)           // path to Pikachu back sprite
sprites.frontShiny(25)     // shiny front
sprites.backShiny(25)      // shiny back
sprites.artwork(25)        // official artwork
sprites.animatedFront(25)  // animated GIF front
sprites.animatedBack(25)   // animated GIF back
sprites.icon(25)           // small icon
sprites.cry(25)            // cry sound file (.ogg)
sprites.item("pokeball")   // item sprite path
```

> Sprite/cry assets are not included in the npm package (440 MB). Generate them locally with `node scripts/generate.mjs` from the [source repo](https://github.com/user/pokejs-data).

## Raw Data

If you need direct access to the arrays instead of helper functions:

```ts
import {
  POKEMON,           // 1,350 Pokemon
  MOVES,             // 937 moves
  TYPES,             // 21 types (including shadow/stellar/unknown)
  ABILITIES,         // 367 abilities
  ITEMS,             // 2,175 items
  NATURES,           // 25 natures
  EVOLUTION_CHAINS,  // 541 evolution chains
  SPECIES,           // 1,025 species
  BERRIES,           // 64 berries
} from "@objectifthunes/pokejs-data";
```

## TypeScript

Full type definitions are included. Every type is exported:

```ts
import type {
  Pokemon, Move, Ability, Item, Nature, Species, Berry,
  TypeName, StatName, BaseStats, DamageClass, Ailment,
  PokemonType, EvolutionChain, SpriteSet,
} from "@objectifthunes/pokejs-data";
```

## License

MIT