scmJS docs

Library

@scm-js/core: the editor's map code as an npm package — open a map, read and change its triggers, strings, units and settings, run Check Map, write it back.

@scm-js/core is the editor's map code as an npm package: open a .scm, .scx or .chk, read and change its triggers, strings, units, locations and settings, run Check Map, and write the map back. It is the same code scmJS runs, built from the same source, so a map reads and writes through the library exactly as it does in the editor of the same version. It runs in Node.js and in the browser, and needs no game data.

Use it when the editor and the command line do not do the thing you want: a script that changes forty maps the same way, a build step that generates triggers, a check of your own in CI, a tool of your own on top of the format.

npm install @scm-js/core

Node.js 22.12 or newer. The package is ES modules with TypeScript declarations, and its one dependency is mopaq, the MPQ library the editor reads archives with.