wad

0.1.0 • Public • Published

node-wad

Manipulate rock raiders WAD files with ease.

Command line utility

Installation

npm install -g wad

Extracting

wad -x LegoRR0.wad -o LegoRR0

Compressing

wad -c LegoRR1 -o LegoRR1.wad

Node.js library

Installation

npm install wad

Usage

var WAD = require('wad');

Getting an instance

WAD.load(path, cb)

Load an WAD archive into an WAD instance.

  • path: Path to a WAD archive
  • cb: Callback that gets called with err and wad

new WAD()

Create a new, empty, WAD instance.

Using an instance

.add(path, data)

Adds an object to the archive.

  • path: The internal path (e.g. Languages/ObjectiveText.txt)
  • data: Description on how to acquire the data

The data parameter currently only accepts this syntax:

{
  type: 'file',
  path: 'mods/Lego.cfg'
}

.forEach(fn)

Runs fn on every object in the archive.

  • fn: Function that gets called for every object

The objects that gets passed to fn currently has the following attributes:

  • .path: The internal path
  • .data(cb): Fetch the data as a buffer

.save(path, cb)

Saves the archive to a WAD file.

  • path: The output path
  • cb: Callbacks that gets called with err and bytesWritten

bytesWritten is the final size of the archive.

Readme

Keywords

none

Package Sidebar

Install

npm i wad

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • linusu