0.1.0 • Published 12 years ago
wad v0.1.0
node-wad
Manipulate rock raiders WAD files with ease.
Command line utility
Installation
npm install -g wadExtracting
wad -x LegoRR0.wad -o LegoRR0Compressing
wad -c LegoRR1 -o LegoRR1.wadNode.js library
Installation
npm install wadUsage
var WAD = require('wad');Getting an instance
WAD.load(path, cb)
Load an WAD archive into an WAD instance.
path: Path to a WAD archivecb: Callback that gets called witherrandwad
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 pathcb: Callbacks that gets called witherrandbytesWritten
bytesWritten is the final size of the archive.
0.1.0
12 years ago