ModBot API interface module for Node.JS
The API is rather simple, once you require the modbot API like this,
var modbot = require('./modbot')
You can use the following functions Note: All functions return an array or an object with an error in it, check test for result.error before trying to process the array.
modbot.getVersions( callback )
callbackis the function to call on completion
The results will be an array in the first argument of the callback.
modbot.getVersions( function(versionList) { console.log(versionList); });
All the other functions have a similar syntax.
modbot.getMods( version, callback, [forceSync] )
versionis the minecraft versioncallbackis the function to handle the resultsforceSyncis an optional parameter that will force new results to be downloaded
modbot.getModsByAuthor( version, author, callback, [forceSync] )
versionis the minecraft versionauthoris the name of the author to filter by (not case sensitive)callbackto handle the resultsforceSyncto force new results to be downloaded
modbot.getModsByName( version, name, callback, [forceSync] )
versionis the minecraft versionnameis the mod name (not case sennsitive)callbackto handle the resultsforceSyncto force new results
The callbacks will be provided an array of matching results, even in the case of only one result from a ByName or ByAuthor query, there will still be an array of 1 element.
Each object will have a set collection of properties that may or may not contain a value
namethe mod nameversionthe mod versionlongurlthe full url to the modshorturlthe short url to the modaliasesaliases that the mod may also be known ascommentadditional community supplied commentsdevthe version number of the latest dev buildauthorthe mod author