Utilities for mojo.js packages
npm install @mojojs/util


Just a bunch of utility functions and classes shared by mojo.js packages.
``js
import {SafeString, escapeRegExp, xmlEscape, xmlUnescape} from '@mojojs/util';
// "te\*s\?t"
const str = escapeRegExp('te*s?t');
// "<p>"
const str = xmlEscape('
');
// "
"
const str = xmlEscape(new SafeString('
'));
// "
"
const str = xmlUnescape('<p>'');
`
All you need is Node.js 16.0.0 (or newer).
```
$ npm install @mojojs/util
If you have any questions the documentation might not yet answer, don't hesitate to ask in the
Forum, on Matrix, or
IRC.