html-es6cape

Escape HTML special characters (including `)

MIT 8 个版本
安装
npm install html-es6cape
yarn add html-es6cape
pnpm add html-es6cape
bun add html-es6cape
README

html-es6cape

version issues downloads license

Escape HTML special characters (including `).

Please note the pun in the package name! :zap:

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."!

版本列表
2.0.2 2022-04-11
2.0.0 2021-03-20
1.0.5 2015-12-05
1.0.4 2015-11-06
1.0.3 2015-11-06
1.0.2 2015-10-28
1.0.1 2015-10-27
1.0.0 2015-10-26