pogo-data-generator v1.18.4
Pogo Data Generator
Generates templated data for Pokemon GO related projects, including:
- Pokemon
- Forms
- Costumes
- Moves
- Items
- Team Rocket Invasions
- Pokemon Types
- Weather
- Translations
- Quest Conditions
- Quest Types
- Quest Reward Types
- Future Pokemon via PokeAPI
Current Status
- Internally the typing is strong, however, the return results are typed pretty horribly due to this being my first TypeScript project. Going to work on this in the 2.0 release.
Installing/Usage
Package
// with npm
npm install pogo-data-generator
// with yarn
yarn add pogo-data-generatorUsage:
// commonJS
const { generate } = require('pogo-data-generator')
// es6 with invasion function
import { generate, invasions } from 'pogo-data-generator'
const data = await generate() // returns the default settings
const template = {
pokemon: {
enabled: true,
options: {
snake_case: true,
unsetDefaultForm: true,
},
template: {
pokemonName: true,
pokedexId: true,
forms: {
formName: true,
proto: true,
},
},
},
types: {
enabled: true,
template: {
typeName: true,
},
},
moves: {
enabled: false,
},
items: {
enabled: true,
options: {
customFields: {
itemId: 'id',
},
},
template: {
itemId: true,
type: true,
minTrainerLevel: true,
},
},
questRewards: {
enabled: false,
},
questConditions: {
enabled: false,
},
invasions: {
enabled: true,
},
weather: {
enabled: true,
},
translations: {
enabled: true,
options: {
masterfileLocale: 'de',
},
locales: {
en: true,
de: true,
},
},
}
const customData = await generate({ template }) // returns custom templated data
const tr = await invasions()
// returns the default settingsLocal Usage/Testing
- Clone the repo
yarn installtscwill compile the TS into JS, then you can runyarn generate, which will generate a localmasterfile.jsonfor you to checkout
tsc -wwill auto recompile the TypeScript during development- You can play with the input options by changing the scripts in
package.jsonor modifying thebase.tsfile. yarn pokeapi, which will generate a localmasterfile.jsonand refresh the data in thestaticfolder from PokeAPIyarn rawwill generate a localmasterfile.jsonand with the raw data format
The generate function accepts an object with the following properties:
template(object): Your template for each of the categoriessafe(boolean): Fetches an already built masterfile with known safe valuesurl(string): Custom url to fetch the masterfile from, results not guaranteedtest(boolean): Writes the masterfile to a local jsonraw(boolean): Returns the data in its raw format without any template processingpokeApi(boolean): Fetches fresh data from PokeAPI
To view some static examples of what this library can create, check out these repos: Masterfiles Translations
To view the full list of available options, check out the Wiki!
9 months ago
9 months ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago