@mojojs/util
TypeScript icon, indicating that this package has built-in type declarations

1.6.7 • Public • Published

Coverage Status npm

Just a bunch of utility functions and classes shared by mojo.js packages.

import {SafeString, escapeRegExp, xmlEscape, xmlUnescape} from '@mojojs/util';

// "te\*s\?t"
const str = escapeRegExp('te*s?t');

// "<p>"
const str = xmlEscape('<p>');

// "<p>"
const str = xmlEscape(new SafeString('<p>'));

// "<p>"
const str = xmlUnescape('&lt;p&gt;&apos;');

Installation

All you need is Node.js 16.0.0 (or newer).

$ npm install @mojojs/util

Support

If you have any questions the documentation might not yet answer, don't hesitate to ask in the Forum, on Matrix, or IRC.

/@mojojs/util/

    Package Sidebar

    Install

    npm i @mojojs/util

    Homepage

    mojojs.org

    Weekly Downloads

    718

    Version

    1.6.7

    License

    MIT

    Unpacked Size

    22.6 kB

    Total Files

    6

    Last publish

    Collaborators

    • kraih
    • marcusramberg
    • joelberger
    • grinnz