0.0.1 • Published 9 years ago
node-erepublik v0.0.1
node-erepublik
A Node.js wrapper for the eRepublik API
Usage
The easier way:
var erepublik = require('node-erepublik');
var erep = new erepublik.Adapter();
var callback = function(error, response) { console.log(response) };
erep.citizenProfile(citizenId, callback);
erep.countryRegions(countryId, callback);
erep.countriesIndex(callback);
erep.regionCitizens(regionId, page, callback);
erep.mapData(callback);
erep.industriesIndex(callback);
erep.battleIndex(battleId, callback);
erep.warBattles(warId, callback);
Some JSON response examples are on /examples
.
You can also have some more control:
var erepublik = require('node-erepublik');
var connector = new erepublik.Connector();
connector.fetch(resource, action, paramsObj, function(error, body){
console.log(body); //full response object from the API
});
How to contribute
Send your pull request! Don't forget a proper test (we use mocha
) and, if possible, an example of the API response.
0.0.1
9 years ago