@altrd/mpformat
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Maniaplanet Formatting Utilities

UMD/ESM TypeScript port of maniaplanet-style-js-parser with some tweaks.

Installation

$ npm i -S @altrd/mpformat

Usage

In node.js or browser via webpack/parcel/etc:

// node.js
const { parse, toHTML, toPlainText } = require('@altrd/mpformat')
// webpack/parcel/etc (TypeScript supported)
import { parse, toHTML, toPlainText } from '@altrd/mpformat'

const html = toHTML(parse('$f00Red')) // => '<span style="color: #ff0000;">Red</span>'
const text = toHTML(parse('$f00Red')) // => 'Red'

In the browser via unpkg

<script src="https://unpkg.com/@altrd/mpformat"></script>
MPFormat.toHTML(MPFormat.parse('$f00Red'))

Readme

Keywords

none

Package Sidebar

Install

npm i @altrd/mpformat

Weekly Downloads

3

Version

0.2.0

License

MIT

Unpacked Size

79.9 kB

Total Files

19

Last publish

Collaborators

  • akxcv