##A wrapper for the RotMG API
npm install realmapi
###usage
realmapi(path, options, callback)
path
: the path you want to query, for examplechar/list
orapp/init
options
: (optional) object with parameters for the query; seepaths
definition inindex.js
for available and required parameters for each pathoptions.host
: optionally choose which domain to query:testing
,production
, or specify your own; defaults toproduction
callback(err, res)
: a node-style callback function; if you don't specify it, the query will still be executed but you will never know if it succeedederr
is set even if the request succeeded and the response was<Failure>
or<Error>
res
is always a parsed json representation of the response, be it xml or json originally. For xml,explicitArray
is off andmergeAttrs
is on, readxml2js
docs for details.
###example
see example.js