Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including wow-classic-items with all npm packages installed. Try it out:

var wowClassicItems = require("wow-classic-items")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

wow-classic-items v0.8.1

Collection of all WoW Classic items.

WoW Classic Items

npm Discord

This project aims to provide a well-rounded WoW Classic database and to make that available for use in your project, by scraping Wowhead and the official Blizzard API.

Current content:

  • Items (General properties, icons, tooltips, crafting, sources)
  • Professions
  • Zones
  • Classes


Installation

npm install wow-classic-items

This package is currently laid out for node.js, as this is what we're using in production. However, if you need the database available for another language, simply read in the JSON yourself from /data/json


Usage

const Database = require('wow-classic-items')

const items = new Database.Items(options)
const professions = new Database.Professions(options)
const zones = new Database.Zones(options)
const classes = new Database.Classes(options)

items is functionally identical to an array and can be used as such:

items[0] // Returns first item
items.filter((i) => i.class === 'Weapon')
items.map((i) => i.itemId)

items.getItemLink(123468) // Returns copy paste-able ingame link
professions.get('Alchemy') // .get returns specified profession


Item Properties

[{
  itemId: 19019, // Unique Item Id
  name: 'Thunderfury, Blessed Blade of the Windseeker', // Display name
  icon: 'inv_sword_39', // Display icon
  class: 'Weapon', // Item class
  subclass: 'Sword', // Item subclass, if available
  sellPrice: 255355, // Price for what this item can be sold to a vendor
  quality: 'Legendary', // Item quality
  itemLevel: 80, // Item level
  requiredLevel: 60, // Required level for this item
  slot: 'One-Hand', // Item slot
  tooltip: [Object], // Item tooltip (see below)
  itemLink: '|cffff8000|Hitem:19019::::::::::0|h[Thunderfury, Blessed Blade of the Windseeker]|h|r', // Copy-pasteable ingame item link
  uniqueName: 'thunderfury-blessed-blade-of-the-windseeker', // Unique item name
  contentPhase: 3, // Content phase in which this item becomes available
  vendorPrice: 1312, // Weighted vendor price if this item can be bought from a vendor
  source: { // Source, either Boss Drop, Rare Drop, Zone Drop or Quest
    category: 'Boss Drop',
    name: 'Some Random Boss', // Only set on Boss Drop
    zone: [209], // Only set on Zone Drop or Boss Drop
    dropChance: 0.33, // Only set on Drops
    quests: [{ questId: 256, name: 'Some Random Quest', faction: 'Horde' }] // Only set on Quest
  }
}, ...]
Tooltip

The tooltip is built the following way:

[{ label: 'Thunderfury, Blessed Blade of the Windseeker', format: 'Legendary' }, ...]

Each label represents one line in the tooltip. The format field specifies if theres a special formatting:

FormatMeaning
QualityIf there is a quality (Common, Rare, Legendary...) it specifies the corresponding color of the label.
MiscThis also refers to the label color: The item level and flavor text.
alignRightThis means that the label is aligned inline to the right of the previous label (for example Armor ---- Plate).
indentThis means that the label is indented and should be treated as if it was quality Poor (for example in set pieces).

Note that the actual sell price is not included in the tooltip (just the label), so you can format it how you want.


Configuration

OptionDefaultDescription
iconSrc'blizzard'Specifies from which source the item icon URL's are generated. Valid values are 'blizzard', 'wowhead' and false (in this case only the icon name is returned).


Building and Testing

The professions database is currently handmade.
Build the item database (default output is /data/build/data.json):

npm run build

After that you can verify the build and/or check the changes between yours and the current one with:

npm run verify

Test the item class with:

npm test



License

MIT

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free