poe-ninja-api-manager - npm

文章推薦指數: 80 %
投票人數:10人

Access item data easily and update, save and load data from poe.ninja with NodeJS. Latest version: 0.7.0, last published: 4 years ago. poe-ninja-api-manager0.7.0 • Public • Published4yearsagoReadmeExploreBETA3Dependencies0Dependents26Versionspoe-ninja-api-manager Contents Changelog GettingStarted NinjaAPI GettingStarted Installwithnpm: $ npm install poe-ninja-api-manager Exampleusage: var NinjaAPI = require("poe-ninja-api-manager"); var ninjaAPI = new NinjaAPI({  league: "Standard"}); // Update data, then save data, then get item data for Atziri"s Splendour, 5 link, Energy Shield variantninjaAPI.update().then((result) => {  console.log("Updated data, here are the results of the requests:", result);  return ninjaAPI.save();}).then((success) => {  console.log("Saved data", success);  return ninjaAPI.getItem("Atziri's Splendour", {links: 5, variant: "ES"});}).then((item) => {  return console.log("An item matching the query was found", item);}).catch((err) => {  console.log(err);}); NinjaAPI Kind:globalclass NinjaAPI newNinjaAPI([options]) .update([options])⇒Promise .getItem(name,[options])⇒Promise .getCurrencyDetails(name)⇒object .hasData([league])⇒boolean .getLeague()⇒string .setLeague(league) .load()⇒Promise .save()⇒Promise .isUpdating()⇒boolean newNinjaAPI([options]) CreatesanewNinjaAPIobject Param Type Default Description [options] Object Anoptionaloptionsobject [options.league] string "Standard" Leaguethatshouldbeusedasdefault [options.path] string "./" Pathwheredatashouldbesaved [options.dataFile] string "ninjaData.json" Fileinwhichdatashouldbesaved ninjaAPI.update([options])⇒Promise Updatesdatafrompoe.ninjaforaspecificleague. Kind:instancemethodofNinjaAPI Fulfil:Array-AnarrayofobjectscontainingtherequesteddataofeachAPI Reject:Error-Theerror.messagecontainsinformationaboutwhythepromisewasrejected Param Type Default Description [options] Object Anoptionaloptionsobject [options.league] string "Standard" Leaguethatshouldbeupdated [options.delay] string 200 DelaybetweenAPIcalls ninjaAPI.getItem(name,[options])⇒Promise Returnsdataforanitemfromthecurrentlyloadedpoe.ninjadataobject. Thereturneditemobjectisthesameyou'dreceivefrompoe.ninja,butithasanadditionalpropertyapiType. Theoptionaloptionsdonoapplyforcurrencyitems,exceptforoptions.league. Kind:instancemethodofNinjaAPI Fulfil:Array-Anarraycontainingthematchingitemasanobject.Ifyoureceivemultipleobjects,pleaseopenanissue. Reject:Error-Theerror.messagecontainsinformationaboutwhythepromisewasrejected Param Type Default Description name String Nameoftheitem [options] Object Anoptionaloptionsobject [options.league] string "Standard" Leaguethatshouldbesearched [options.links] string 0 Linkstheitemshouldhave [options.variant] string null Variantoftheitem.Ifnovariantisspecified,anyvariantoftheitemwillbereturned,butpreferablythedefault(nullvariant)oftheitem [options.fallbackVariant] string null Ifavariantwasspecifiedbutnotfound,trytofindthisinstead.Usefulfordefaultinggemstothelevel20variant [options.relic] string false Settotruefortherelicversionoftheitem [options.baseType] string null Basetypeoftheitem.Isignoredifnotspecified ninjaAPI.getCurrencyDetails(name)⇒object Returnsanobjectcontainingdetailsaboutacurrencyitem. Returnsanemptyobjectifnodataisavailableforthespecifiedcurrencyname. Kind:instancemethodofNinjaAPI Param Type Description name string Nameofthecurrency ninjaAPI.hasData([league])⇒boolean Returnstrueifanypoe.ninjadataisavailable. Thismeansthatithasbeenloadedorupdatedbeforecallingthismethod. Kind:instancemethodofNinjaAPI Param Type Description [league] string Bysettingaleague,truewillbereturnedifthere'sdataforthisleague ninjaAPI.getLeague()⇒string Returnstheleaguethatiscurrentlysetasdefault. Kind:instancemethodofNinjaAPI ninjaAPI.setLeague(league) Setsaleagueasdefault. Kind:instancemethodofNinjaAPI Param Type Description league string Leaguethatshouldbesetasdefault ninjaAPI.load()⇒Promise Loadspreviouslysaveddatafromfile. Kind:instancemethodofNinjaAPI Fulfil:boolean-trueifthedatawasloadedsuccessfully Reject:Error-Theerror.messagecontainsinformationaboutwhythepromisewasrejected ninjaAPI.save()⇒Promise Savesthecurrentlyloadedorupdateddatatofile. Kind:instancemethodofNinjaAPI Fulfil:boolean-trueifthedatawassavedsuccessfully Reject:Error-Theerror.messagecontainsinformationaboutwhythepromisewasrejected ninjaAPI.isUpdating()⇒boolean Returnstrueifdataiscurrentlybeingupdated Kind:instancemethodofNinjaAPI Keywordspoepathofexilepoe.ninjaapimanagerInstallnpmipoe-ninja-api-managerRepositoryGitgithub.com/klayveR/poe-ninja-api-managerHomepagegithub.com/klayveR/poe-ninja-api-manager#readmeDownloadsWeeklyDownloads32Version0.7.0LicenseMITUnpackedSize33.3kBTotalFiles6Lastpublish4yearsagoCollaboratorsTryonRunKitReportmalware



請為這篇文章評分?