duke3d-group
v1.0.2
Published
A module for reading, writing, interacting with and manipulating Duke Nukem 3D group files.
Downloads
10
Maintainers
Readme
Duke3D Group
A module for reading and writing Duke Nukem 3D group files.
Usage
const Group = require("duke3d-group");
// creating and writing a group to a file:
const group = new Group("TEST.GRP");
group.addFile(new Group.File("GAME.CON", Buffer.from("define MAXPLAYERHEALTH 420")));
group.addDirectory("C:\\TCs\\Awesome_TC\\");
group.writeTo("C:\\TCs\\AWESOME.GRP");
// reading, interacting and extracting files with / from a group:
const epicNukeGroup = Group.readFrom("C:\\TCs\EPICNUKE.GRP");
console.log("Number of Files: " + epicNukeGroup.numberOfFiles());
epicNukeGroup.extractAllFiles("C:\\TCs\\EpicNukem\\");
const conFiles = epicNukeGroup.getFilesWithExtension("CON");
for(let i = 0; i < conFiles.length; i++) {
console.log(conFiles[i].name);
}
Installation
To install this module:
npm install duke3d-group