Coder Social home page Coder Social logo

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

Mangudai's Projects

sublime-text icon sublime-text

Age of Empires 2 Random Map Script syntax highlighting for Sublime Text

vscode icon vscode

Age of Empires 2 Random Map Scripting support for Visual Studio Code

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.