Socket
Socket
Sign inDemoInstall

pokenode

Package Overview
Dependencies
47
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pokenode

NodeJS wrapper for the Pokemon API.


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

NPM version NPM downloads MIT License Build Status

Pokénode

A NodeJS wrapper for the Pokéapi.

Install via npm:

npm install --save pokenode

API Reference

Using this wrapper will invoke the same restrictions as hitting the API with REST calls. So there is no authentication, but you are limited to 300 requests per resource per IP address.

We follow the same naming conventions as the official API, so check the documentation for all available features. Here's a quick example. To get Bulbasaur, the equivalent of a call to GET http://pokeapi.co/api/v1/pokemon/1/, do the following:

var pokeAPI = require('pokenode');

pokeAPI.pokemon(1, function(err, data) {
    if(err) {
        // handle err
    } else {
        // have some data about Bulbasaur
    }
});

Available functions are pokedex, pokemon, type, move, ability, pokemon, egg, description, sprite, and game. The function pokedex takes no parameters, just a callback function.

You do not have to know the index of a type to get the resource. Instead, you may call:

pokeAPI.type('fire', function(err, data) { ...

To get the fire object.

Something else?

The Pokéapi is currently at version 1. In case that ever changes, you can set the version number with:

var pokeAPI = require('pokenode');
pokeAPI.version(2);

Version History

  • 0.1.2 Bugfix - return apiCall if resource not defined
  • 0.1.1 Basically because I felt like it
  • 0.1.0 Initial release

Keywords

FAQs

Last updated on 16 Jun 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc