mangudai
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

Mangudai

AoE2 Random Map Scripting for humans

JavaScript parser and linter for Random Map Scripts (RMS) for the Age of Empires II video game.

Install

Mangudai is published as an NPM package compatible with Node.js and browsers.

npm install mangudai

Use a tool like Webpack or Rollup to include Mangudai in your front-end app.

The code is compiled to ES5 (old and stable JavaScript) before publishing, so the module has maximum compatibility out-of-the-box.

Usage

Let's parse an RMS script into an Abstract Syntax Tree (AST) and lint it.

import { parse, lint } from 'mangudai'
 
const { ast, errors } = parse('<PLAYER_SETUP> \n random_placement')
 
if (errors.length) {
  console.log('Unable to parse the script! Probably invalid syntax.', errors)
} else {
  const lintErrors = lint(ast)
  console.log(`Linter found ${lintErrors.length} problems.`, lintErrors)
}

Mangudai is written in TypeScript and exports all relevant typings.

API

Contribute

Travis status Test coverage TypeScript Style Guide Standard Readme

This project is still in its early development stage. Any help is greatly appreciated! Feel free to ask questions in issues. PRs accepted.

License

MIT © Mangudai contributors

Package Sidebar

Install

npm i mangudai

Weekly Downloads

12

Version

0.3.0

License

MIT

Unpacked Size

401 kB

Total Files

85

Last publish

Collaborators

  • deltaidea