Parses itemtexts from the Path of Exile client (obtained via CTRL+C).
Please check out the documentation for more information.
Install with npm:
$ npm i @klayver/poe-itemtext-parser --save
- Affixes are parsed incorrectly for magic, rare and unique items that have no explicit affixes
import fs from "fs";
import util from "util";
import { Parser } from "@klayver/poe-itemtext-parser";
const readFile = util.promisify(fs.readFile);
void (async () => {
const itemtext = await readFile("some_itemtext.txt", "UTF-8");
const item = new Parser(itemtext);
const data = {
rarity: item.rarity,
name: item.name,
flags: item.flags,
sockets: item.sockets,
note: item.note,
itemLevel: item.itemLevel,
quality: item.quality,
stackSize: item.stackSize,
gem: item.gem,
requirements: item.requirements,
map: item.map,
talisman: item.talisman,
beast: item.beast,
affixes: item.affixes,
flask: item.flask,
offense: item.offense,
defense: item.defense,
baseItem: item.baseItem,
divinationCard: item.divinationCard,
prophecy: item.prophecy,
metamorph: item.metamorph,
};
console.log(JSON.stringify(data));
})();