0.1.0 • Published 8 years ago

pokemon-wrapi v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

Pokéapi Wrapper

Client interface for accessing The RESTful Pokémon API.

NPM version

Installation

Install via npm

npm install pokemon-wrapi --save

Usage

Create a client object to access Pokéapi resources.

var pokeWrapi = require('pokemon-wrapi');

var client = new pokeWrapi();

// Now you are ready to make API calls to Pokéapi.

Provide parameters and a callback.

Resource API calls follow this syntax:

client.resource(name, callback);

  • name - id or name.

Resource list API calls follow this syntax:

client.resource.list(queryString, callback);

  • queryString - (if required) limit & offset are used for pagination.

Examples

Lists all Pokémons.

client.pokemon.list(function(err, data) {
  if (!err) {
    console.log(data);
  } 
});

Get details of a specific Pokémon.

client.pokemon('palkia', function(err, data) {
  if (!err) {
    console.log(data);
  } 
});

API Functions

Berries

Contests

Encounters

Evolution

Games

Items

Machines

Moves

Locations

Pokemon

Utility

License

MIT