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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@na-ji/pogo-protos

v2.162.0

Published

Pokémon Go Protobuf files from POGOProtos, wrapped up in a Node module

Downloads

1,845

Readme

pogo-protos Donate

Uses protobuf.js to compile the Protobuf files from POGOProtos into an easy to use Node module.

Test Build license

How to use

const POGOProtos = require('pogo-protos');

const nbPokemon = Object.keys(POGOProtos.Rpc.HoloPokemonId).length -1;
console.log(`We have ${nbPokemon} pokemons in protos.`);
const nbCostumes = Object.keys(POGOProtos.Rpc.PokemonDisplayProto.Costume).length -1;
console.log(`We have ${nbCostumes} costumes in protos.`);
const nbForms = Object.keys(POGOProtos.Rpc.PokemonDisplayProto.Form).length -1;
console.log(`We have ${nbForms} forms in protos.`);
const nbBadges = Object.keys(POGOProtos.Rpc.HoloBadgeType).length -1;
console.log(`We have ${nbBadges} badges in protos.`);
const nbMoves = Object.keys(POGOProtos.Rpc.HoloPokemonMove).length -1;
console.log(`We have ${nbMoves} moves in protos.`);
const nbItems = Object.keys(POGOProtos.Rpc.Item).length -1;
console.log(`We have ${nbItems} items in protos.`);
const nbMethodRequests = Object.keys(POGOProtos.Rpc.Method).length -1;
console.log(`We have ${nbMethodRequests} method requests in protos.`);
const nbSocialRequests = Object.keys(POGOProtos.Rpc.InternalSocialAction).length -1;
console.log(`We have ${nbSocialRequests} social requests in protos.`);
const nbPlatformRequests = Object.keys(POGOProtos.Rpc.PlatformClientAction).length -1;
console.log(`We have ${nbPlatformRequests} platform requests in protos.`);
const nbGameActionClientRequests = Object.keys(POGOProtos.Rpc.GameBackgroundModeAction).length -1;
console.log(`We have ${nbGameActionClientRequests} game action client requests in protos.`);
const nbGameActionRequests = Object.keys(POGOProtos.Rpc.GameIapAction).length -1;
console.log(`We have ${nbGameActionRequests} game action requests in protos.`);
const nbGameAdventureSyncRequests = Object.keys(POGOProtos.Rpc.GameAdventureSyncAction).length -1;
console.log(`We have ${nbGameAdventureSyncRequests} game adventure sync requests in protos.`);
const nbPGameOthersRequests = Object.keys(POGOProtos.Rpc.GameAccountRegistryActions).length -1;
console.log(`We have ${nbPGameOthersRequests} game others requests in protos.`);
const nbPlayerSubmissionsRequests = Object.keys(POGOProtos.Rpc.TitanPlayerSubmissionAction).length -1;
console.log(`We have ${nbPlayerSubmissionsRequests} Player Submissions requests in protos.`);
const nbGamefitnessRequests = Object.keys(POGOProtos.Rpc.GameFitnessAction).length -1;
console.log(`We have ${nbGamefitnessRequests} game fitness requests in protos.`);

// Count of all req's
const all_in_one = nbMethodRequests 
+ nbSocialRequests 
+ nbPlatformRequests 
+ nbGameActionClientRequests 
+ nbGameActionRequests 
+ nbGameAdventureSyncRequests 
+ nbPGameOthersRequests 
+ nbPlayerSubmissionsRequests 
+ nbGamefitnessRequests;

console.log(`We have ${all_in_one} (GLOBAL) multi method requests in protos.\n`);

var myMessage = POGOProtos.Rpc.RecycleItemProto.fromObject({
    item: POGOProtos.Rpc.Item.ITEM_POTION,
    count: 50
});
  
var encoded = POGOProtos.Rpc.RecycleItemProto.encode(myMessage).finish();
var decodedAgain = POGOProtos.Rpc.RecycleItemProto.decode(encoded);
console.log('Test encode/decode:\nItem: ' + decodedAgain.item + ' count: ' + decodedAgain.count);

// will print:
// We have x pokemons in protos.
// We have x costumes in protos.
// We have x forms in protos.
// We have x badges in protos.
// We have x moves in protos.
// We have x items in protos.
// We have x method requests in protos.
// We have x social requests in protos.
// We have x platform requests in protos.
// We have x game action client requests in protos.
// We have x game action requests in protos.
// We have x game adventure sync requests in protos.
// We have x game others requests in protos.
// We have x Player Submissions requests in protos.
// We have x game fitness requests in protos.
// We have x (GLOBAL) multi method requests in protos.

//Test encode/decode:
//Item: 101 count: 50

For more details see the protobuf.js documentation.

Usage with TypeScript

TypeScript definitions are included. Modern IDE should use them automatically.