ee

es-en

A small library which provides methods to escape and unescape HTML entities.

Showing:

Popularity

Downloads/wk

2

GitHub Stars

1

Maintenance

Last Commit

5yrs ago

Contributors

0

Package

Dependencies

2

Size (min+gzip)

0.3KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

HTML-Escaper

Build Status Dependencies npm-version

A small library which provides methods to escape and unescape HTML entities before inserting untrusted data into HTML element content. (XSS prevention)

Installation

npm install -g es-en

Usage


var hescape = require('es-en');
var escape = hescape.escape;
var unescape = hescape.unescape;

var html = '<h1>Help me!</h1>';
var escaped = escape(html);
var unescaped = unescape(escaped);

console.log('html', html, 'escaped', escaped, 'unescaped', unescaped);

html <h1>Help me!</h1> escaped &lt;h1&gt;Help me!&lt;&#x2F;h1&gt; unescaped <h1>Help me!</h1>

Tests

 npm test

Contributing

Add unit tests for any new or changed functionality.

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100