bgfiles

0.0.5 • Public • Published

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 type
  • buffer: 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 type
  • object: Object to be serialized

Supported file types

  • 2da: 2D Array
  • ids: Identifiers
  • itm: Item
  • key: Key file
  • sto: Store
  • tlk: Talk (language) file

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i bgfiles

      Weekly Downloads

      0

      Version

      0.0.5

      License

      WTFPL

      Last publish

      Collaborators

      • eleandor