
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
wc3maptranslator
Advanced tools
Module to translate between `war3map` and `json` formats for WarCraft III .w3x maps
WC3MapTranslator
Translate war3map ⇄ json formats for WarCraft III .w3x maps
Overview · Install · Usage · File Support · Specification · Contributing · Special Thanks
WC3MapTranslator is a TypeScript module and CLI to convert between JSON and WarCraft III (.w3x) war3map formats. This makes the map data readable and easily modifiable, a perfect format for storing WC3 maps in Git repositories and inspecting diffs!

# Global install recommended for CLI usage; for local install drop the -g flag
npm install -g wc3maptranslator
Requires Node ≥ 24
# wc3maptranslator <input> [output]
# Usage (individual files, same directory)
wc3maptranslator terrain.json # outputs war3map.w3e in CWD
wc3maptranslator war3map.w3i # outputs info.json in CWD
# Usage (translate an entire folder)
wc3maptranslator ./path/to/war3mapFiles --toJson
wc3maptranslator ./path/to/jsonFiles --toWar
# See list of available translators and standard file names
wc3maptranslator --list
# See help
wc3maptranslator --help
# Useful flags
--force / -f Overwrite existing files (by default, translation is skipped if it would overwrite an existing file)
--silent / -s Silence success output messages (errors will still be shown)
import {
CamerasTranslator,
DoodadsTranslator,
ImportsTranslator,
InfoTranslator,
ObjectsTranslator,
RegionsTranslator,
SoundsTranslator,
StringsTranslator,
TerrainTranslator,
UnitsTranslator
} from 'wc3maptranslator';
// E.g. let's create a camera for the map
const cameras = [
{
"target": {
"x": -319.01,
"y": -90.18
},
"offsetZ": 0,
"rotation": 90,
"aoa": 304,
"distance": 2657.34,
"roll": 5,
"fov": 70,
"farClipping": 5000,
"name": "MyCamera1"
}
]
// Now translate the JSON into the WarCraft III format
// All translators have: `.jsonToWar` and `.warToJson` functions
const translatedResult = CamerasTranslator.jsonToWar(cameras);
// `translatedResult` contains a `buffer` which can be saved to disk
// This war3map.w3c file can now be placed inside a .w3x via an MPQ
// editor, and you should now see a camera in the Camera Palette!
fs.writeFileSync('war3map.w3c', translatedResult.buffer);
| Type | Json → War | War → Json | File |
|---|---|---|---|
| Terrain | ✅ | ✅ | war3map.w3e |
| Units | ✅ | ✅ | war3mapUnits.doo |
| Doodads | ✅ | ✅ | war3map.doo |
| Regions | ✅ | ✅ | war3map.w3r |
| Cameras | ✅ | ✅ | war3map.w3c |
| Type | Json → War | War → Json | File |
|---|---|---|---|
| Units - Objects | ✅ | ✅ | war3map.w3u |
| Items - Objects | ✅ | ✅ | war3map.w3t |
| Abilities - Objects | ✅ | ✅ | war3map.w3a |
| Destructables - Objects | ✅ | ✅ | war3map.w3b / war3mapSkin.w3b |
| Doodads - Objects | ✅ | ✅ | war3map.w3d |
| Upgrades - Objects | ✅ | ✅ | war3map.w3q |
| Buffs - Objects | ✅ | ✅ | war3map.w3h |
| Type | Json → War | War → Json | File |
|---|---|---|---|
| Info File | ✅ | ✅ | war3map.w3i |
| Imported Files | ✅ | ✅ | war3map.imp |
| Sounds (definitions) | ✅ | ✅ | war3map.w3s |
| Strings (triggers) | ✅ | ✅ | war3map.wts |
| Pathing | ❌ | ❌ | war3map.wpm |
| Shadow map | ❌ | ❌ | war3map.shd |
➖ Triggers (war3map.j, war3map.lua)
➖ Custom Text Trigger File (war3map.wct)
➖ Trigger Names File (war3map.wtg)
➖ Menu Minimap (war3map.mmp)
➖ Minimap Image (war3mapMap.blp)
➖ Minimap Image (war3mapMap.b00)
➖ Minimap Image (war3mapMap.tga)
➖ Map Preview Image (war3mapPreview.tga)
We have a detailed explaining how to format a map in JSON. It explains everything from the high-level map object, all the way down to creating individual units, tiles, or custom objects.
The underlying WarCraft map files (e.g. war3map.doo) have been documented in a separate repository. If you are curious about how a .w3x file is composed, this is the place to learn!
We encourage contributions! Generally, the process of making a change is:
masterYour code should:
npm run test and include unit tests to demonstrate your code works under different conditions)npm run lint and follow the project's coding standards)A code review is required on your PR to be accepted into master. A project member will get back to you within one week. If you haven't heard from someone regarding your PR, feel free to ping @chiefofgxbxl.
Your pull request may update package.json to include your username under the contributors field.
If you are updating the CLI, remember to run npm link during local development prior to testing out changes, so the wc3maptranslator command reflects your latest changes.
We owe a lot of thanks to Chocobo on TheHelper for the detailed documentation of the files found in a .w3x archive. Two tutorials are here (1) and here (2).
FAQs
Module to translate between `war3map` and `json` formats for WarCraft III .w3x maps
The npm package wc3maptranslator receives a total of 50 weekly downloads. As such, wc3maptranslator popularity was classified as not popular.
We found that wc3maptranslator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.