Calculate statistics of guildwars2 accounts
This is part of gw2efficiency. Please report all issues in the central repository.
npm install gw2e-account-statistics
This module can be used for Node.js as well as browsers using Browserify.
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
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
npm test
MIT