gw2e-account-statistics
v3.17.0
Published
Calculate statistics of guildwars2 accounts
Downloads
336
Readme
account-statistics
Calculate statistics of guildwars2 accounts
This is part of gw2efficiency. Please report all issues in the central repository.
Install
npm install gw2e-account-statistics
This module can be used for Node.js as well as browsers using Browserify.
Usage
Calculate the statistics
import accountStatistics from 'gw2e-account-statistics'
// An object containing all the account data available for the API key
const accountData = {
account: /* ... */,
characters: /* ... */,
bank: /* ... */,
materials: /* ... */,
commerce: {
buys: /* ... */,
sells: /* ... */
},
skins: /* ... */,
wallet: /* ... */,
dyes: /* ... */,
minis: /* ... */,
outfits: /* ... */,
recipes: /* ... */,
guilds: /* ... */,
inventory: /* ... */,
titles: /* ... */,
achievements: /* ... */,
pvp: {
stats: /* ... */,
// ...
}
}
// Extra information for context-dependent statistics
const extraInformation = {
pvp: { currentSeason: 'SEASON-ID' },
skins: { typeMap: { Armor: [1, 2, 3], Weapon: [1, 2, 3], Back: [1, 2, 3] } }
}
// Calculate everything!
accountStatistics(accountData, extraInformation)
// -> Object with all statistics calculated
Calculate a part of the account statistics
You can import the partial calculations on their own and work with them.
import unlocks from 'gw2e-account-statistics/build/statistics/unlocks'
unlocks(accountData)
// -> Only the "unlocks" statistics
Tests
npm test
Licence
MIT