Koffing is a Pokemon Showdown Team parser that converts your strategies to machine-readable JSON code.
Pokémon Showdown is the most popular online Pokémon battle simulator, one of the best ways to quickly try your strategies for the official Pokémon VGC Championships. This library is just a parser for the teams generated by the Showdown Team Builder exports.
This repository holds the source code for the library as well as the code for the Online Parser. The Online Parser, does not require you to download any library or script, it is recommended if all you want is to sanitize, prettify or convert to JSON your Showdown team exports.
- Compatible with web browsers and NodeJS, including ES6+ imports
- Converts from Showdown code to JSON
- Converts from JSON to Showdown code
- Sanitizes Showdown code (removing invalid data, applying max and mins values, etc.)
- Prettifies Showdown code (proper indentation, line breaks and sorting of the data, etc.)
- Online Parser, which is using the library featuring all the above mentioned.
As a package:
npm i --save koffing
In the browser, using a CDN:
"use strict";;const teamCode = `=== [gen7] Folder 1/Example Team ===Smogon (Koffing) (F) @ EvioliteLevel: 5Ability: LevitateShiny: YesHappiness: 255EVs: 36 HP / 236 Def / 236 SpDIVs: 31 HP / 30 Atk / 31 SpA / 30 SpD / 31 SpeBold Nature- Will-O-Wisp- Pain Split- Sludge Bomb- Fire Blast`;let parsedTeam = Koffing;// This will log a PokémonTeamSet object:console;// Convert it back to the Showdown format (prettified):console;// which is the same as:console;// and the same as:console;// You can also convert the object to JSON:console;// which is the same as:console;
const Koffing = Koffing;const teamCode = `=== [gen7] Folder 1/Example Team ===`;let parsedTeam = Koffing;console;
Koffing class is basically a wrapper of the
ShowdownParser class, the difference is that it can be used statically.
ShowdownParser class methods:
parse(): PokemonTeamSet: Parses the Showdown code and returns a
format(): String: Parses the Showdown code and returns a prettified and sanitized version of it.
toString(): String: Basically returns the internal Showdown code string as it is.
Koffing class methods:
static parse(showdownCode): PokemonTeamSet: Wrapper for
static format(showdownCode): String: Wrapper for
static toJson(showdownCode): String: Wrapper for
static toShowdown(jsonCode): String: Wrapper for
This software is copyrighted and licensed under the MIT license.
This software comes bundled with data and graphics extracted from the Pokémon series of video games. Some terminology from the Pokémon franchise is also necessarily used within the software itself. This is all the intellectual property of Nintendo, Creatures, inc., and GAME FREAK, inc. and is protected by various copyrights and trademarks.
The authors believe that the use of this intellectual property for a fan reference is covered by fair use and that the software is significantly impaired without said property included. Any use of this copyrighted property is at your own legal risk.
This software is not affiliated in any way with Nintendo, Pokémon or any other game company.
A complete revision history of this software is available from https://github.com/capsulemonsters/koffing