Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

duke3d-group

1.0.2 • Public • Published

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

Install

npm i duke3d-group

DownloadsWeekly Downloads

8

Version

1.0.2

License

MIT

Unpacked Size

24.3 kB

Total Files

4

Last publish

Collaborators

  • avatar