Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mech-mpq

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mech-mpq

A StormLib MPQ wrapper.

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

mech-mpq

A StormLib MPQ wrapper for Node.js.

Installation

npm install mech-mpq --save

Example

Open an MPQ archive and read a file:

var mpq = require('mech-mpq');

function getFileContents(mpqPath, filePath) {
    var archive = mpq.openArchive(mpqPath);
    if (archive) {
        var file = archive.openFile(filePath);
        if (file) {
            var fileContents = file.read();
            file.close();
            return fileContents;
        }
    }
    return null;
}

var fileContents = getFileContents('./path/to/archive.mpq', 'filename.txt');
if (fileContents) {
    console.log(fileContents.length);
    console.log(fileContents);
}

See the tests for more examples.

Dev

Compilation

  1. Clone:
  • git clone https://github.com/mechanica/MPQ.git
  1. Checkout submodules:
  • git submodule init && git submodule update
  1. Build:
  • npm install
  1. Run tests:
  • npm test

Keywords

FAQs

Package last updated on 06 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc