Socket
Socket
Sign inDemoInstall

mangudai

Package Overview
Dependencies
14
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mangudai

AoE2 Random Map Scripting for humans


Version published
Weekly downloads
15
increased by15.38%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

  • parse( script: string ) => { ast: Script, errors: ParseError[] }

  • lint( ast: Script ) => LintError[]

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

Keywords

FAQs

Last updated on 08 Jul 2018

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc