html-es6cape
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

html-es6cape

version issues downloads license

Escape HTML special characters (including `).

Please note the pun in the package name!

Installation

This package is distributed via npm:

npm install html-es6cape

Usage

const escape = require("html-es6cape");

var unescapedString = `This is an evil unescaped string <"'&'">! #whoopwhoop`;
var escapedString = escape(unescapedString);
// "This is a nice escaped string &lt;&quot;&#39;&amp;&#39;&quot;&gt;! #whoopwhoop"

- or -

import escape from "html-es6cape";

var unescapedString = `This is an evil unescaped string <"'&'">! #whoopwhoop`;
var escapedString = escape(unescapedString);
// "This is a nice escaped string &lt;&quot;&#39;&amp;&#39;&quot;&gt;! #whoopwhoop"

- or -

import escape from "html-es6cape";

var escapedString = escape`This is an evil unescaped string <"'&'">! #whoopwhoop`;
// "This is a nice escaped string &lt;&quot;&#39;&amp;&#39;&quot;&gt;! #whoopwhoop"

License

MIT

Thanks

Special thanks to my family, my friends, my bae ... and Kent C. Dodds for his series "How to Write a JavaScript Library."!

/html-es6cape/

    Package Sidebar

    Install

    npm i html-es6cape

    Weekly Downloads

    1,963

    Version

    2.0.2

    License

    MIT

    Unpacked Size

    4.97 kB

    Total Files

    6

    Last publish

    Collaborators

    • antoniovdlc