gw2e-item-value
v3.4.35
Published
Calculate the value of guildwars2 items
Downloads
406
Readme
item-value
Calculate the value of guildwars2 items
This is part of gw2efficiency. Please report all issues in the central repository.
Install
npm install gw2e-item-valueThis module can be used for Node.js as well as browsers using Browserify.
Usage
For better understanding of how and why this does things, please read the design document for the account value.
Calculate the item value
import {itemValue} from 'gw2e-account-value'
let item = {
id: 1,
sell: {price: 1337, last_known: 1337},
buy: {price: 12, last_known: 12},
crafting: {buy: 10000},
vendor_price: 5
// ...
}
let value = itemValue(item)
// -> 1337Get the inherited item
import {itemInherits} from 'gw2e-account-value'
let item = {id: 1, /* ... */}
let itemInheritance = itemInherits(item.id)
// -> [{id: 19721, count: 50}, {gold: 888888}]
// -> false for items that don't inherit value from other itemsTests
npm testLicence
MIT
