gw2e-item-value

3.4.23 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i gw2e-item-value

Weekly Downloads

18

Version

3.4.23

License

MIT

Unpacked Size

392 kB

Total Files

87

Last publish

Collaborators

  • queicherius