Skip to content

nitro404/duke3d-group

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Duke3D Group

NPM version Build Status Coverage Status Known Vulnerabilities Dependencies Downloads Install Size Contributors Pull Requests Welcome

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

About

A module for reading Duke Nukem 3D group files.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published