html-es6cape

Escape HTML special characters (including `)

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
html-es6cape
552.0.210 months ago7 years agoMinified + gzip package size for html-es6cape in KB

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 <"'&'">! #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 <"'&'">! #whoopwhoop"

- or -
import escape from "html-es6cape";

var escapedString = escape`This is an evil unescaped string <"'&'">! #whoopwhoop`;
// "This is a nice escaped string <"'&'">! #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."!