gw2-resource-utils
v0.1.2
Published
Creates maps of gw2 resources with associated helper utilities.
Downloads
1
Readme
gw2-resource-utils
Creates maps of gw2 resources with associated helper utilities.
Installation
npm install gw2-resource-utils
Api
build (resourceName: string) => Promise<ResourceMap>
import { build } from 'gw2-resource-utils';
const nameToIdMap = await build('items');
// { "MONSTER ONLY Moa Unarmed Pet":1 ... }
ResourceMap
{
"Item Name": 10
}
exact (map: ResourceMap, itemName: string) => ?number
import { exact } from 'gw2-resource-utils';
const itemId = exact(nameToIdMap, 'MONSTER ONLY Moa Unarmed Pet');
// 1
fuzzy (map: ResourceMap, itemName: string) => ?number
import { fuzzy } from 'gw2-resource-utils';
const items = fuzzy(nameToIdMap, 'monster');
// { "Legendary Kudu's Monster Loot Box": 65497, ... }
Testing
npm test