bgfiles
v0.0.5
Published
Baldur's Gate Files
Downloads
3
Maintainers
Readme
bgfiles
Baldur's Gate Files for node.js
Installation
npm install bgfiles
Usage
var fs = require("fs");
var bgfiles = require("bgfiles");
var buffer = fs.readFileSync("CARSOMYR.itm");
var item = bgfiles["itm"].parse(buffer);
item.header.usability.evil = true;
fs.writeFileSync("CARSOMYR.itm", bgfiles["itm"].serialize(item));
API
bgfiles[type].parse(buffer)
Parse a buffer of specified type.
Returns an Object
type
: string identifying the file typebuffer
: Buffer object
bgfiles["sto"].parse(buffer);
bgfiles[type].serialize(object)
Serialize an object of specified type into a buffer.
Returns a Buffer
type
: string identifying the file typeobject
: Object to be serialized
Supported file types
2da
: 2D Arrayids
: Identifiersitm
: Itemkey
: Key filesto
: Storetlk
: Talk (language) file