Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 1.5 KB

README.md

File metadata and controls

59 lines (40 loc) · 1.5 KB

item-value

Build Status Coverage Status

Calculate the value of guildwars2 items

This is part of gw2efficiency. Please report all issues in the central repository.

Install

npm install gw2e-item-value

This 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)
// -> 1337

Get 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 items

Tests

npm test

Licence

MIT