npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pkhex

v25.10.26-a

Published

WebAssembly library wrapping PKHeX.Core for Pokemon save file editing in JavaScript/TypeScript

Readme

PKHeX.js

Provides WebAssembly bindings for PKHeX.Core. Allows editing Pokémon save files in JavaScript environments (Browser, NodeJS, etc). If you find a feature of PKHeX is missing, feel free to send a PR or open an issue.

Installation

You can install the latest version of PKHeX like this:

npm install pkhex

Usage

// Get PKHeX API
import setupPKHeX from 'pkhex';
const pkhex = await setupPKHeX();

// Load a save file
const saveData = await fetch('save.sav').then(r => r.arrayBuffer());
const base64Data = btoa(String.fromCharCode(...new Uint8Array(saveData)));
const result = await pkhex.loadSave(base64Data);

if (result.success) {
  const { handle } = result;

  // Get save info
  const { ot, gameVersion } = await PKHeXApi.getSaveInfo(handle);
  console.log(`Trainer: ${ot}, Game: ${gameVersion}`);
  
  // Get all Pokémon
  const mons = await PKHeXApi.getAllPokemon(handle);
  console.log(`Found ${mons.length} Pokémon`);
  
  // Export modified save
  const { base64Data } = await PKHeXApi.exportSave(handle);
  const saveBytes = Uint8Array.from(atob(base64Data), c => c.charCodeAt(0));
  
  // Free memory after you're done
  await PKHeXApi.disposeSave(handle);
}

API Documentation

API documentation is built autoamtically through GitHub pages.

Features

  • Load and save Pokémon save files (Generations 1-9)
  • Read and modify Pokémon data
  • Edit trainer information
  • Manage items and Pokédex
  • Legality checking
  • Showdown format import/export

Updating PKHeX

The original PKHeX.Core is compiled into WASM from a git submodule at lib/PKHeX. To create a PR for updating (or downgrading) PKHeX, you can change the version of the submodule to a version tag, change package.json for PKHeX.js to match that version, commit the changes, test a build locally with scripts/build.sh, and create a PR.

License

This project uses PKHeX.Core which is licensed under GPLv3.

Credits

Built on top of PKHeX by Kurt.