#parser #mpq #warcraft3

war3parser-wasm

A parser for Warcraft 3 map files

4 releases

new 0.1.4 Jan 17, 2025
0.1.3 Jan 16, 2025
0.1.2 Jan 15, 2025
0.1.1 Jan 15, 2025

#410 in WebAssembly

Download history 101/week @ 2025-01-10

101 downloads per month

MIT license

57KB
1.5K SLoC

war3parser

Crates.io Version docs.rs NPM Version GitHub Actions Workflow Status GitHub Release

war3parser is a library for parsing and extracting Warcraft III map files. It provides functionality to extract data from MPQ files and supports parsing various file formats.

Features

  • Extract files from MPQ archives
  • Support for parsing W3I, WTS, and other file formats
  • Command-line tool for file extraction and export

Usage

use as a library

cargo add war3parser
use war3parser::war3map_metadata::War3MapMetadata;

let metadata = War3MapMetadata::from_file("path/to/map.w3x").unwrap();

println!("{:#?}", metadata);

use as a CLI

cargo install war3parser-cli
$ war3parser-cli help
A parser for Warcraft 3 map files

Usage: war3parser-cli <COMMAND>

Commands:
  extract-file    Extract a file from a MPQ archive and save it [aliases: x]
  extract-images  Extract images with *.tga and *.blp extensions [aliases: i]
  list-files      List files in a MPQ archive [aliases: l]
  help            Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

use as a WASM

npm install @wesleyel/war3parser
import { WasmMapInfo } from "@wesleyel/war3parser";

const mapInfo = WasmMapInfo.new(Uint8Array.from(buffer));

console.log(mapInfo);

Contributing

Contributions are welcome! Please submit a Pull Request or report an Issue.

License

war3parser is licensed under the MIT License. See the LICENSE file for details.

Dependencies

~24MB
~410K SLoC