escape-unescape-html-characters
Version:
This package will convert escaped html characters to unescaped characters and vice versa.
33 lines (20 loc) • 1 kB
Markdown
Thanks for checking out the package.
**USAGE:**
Add the package to your project by using: <br/>
```
npm i escape-unescape-html-characters
```
Import the package wherever you need and use it like this: <br/>
```Javascript
const packageModule = require('escape-unescape-html-characters');
console.log(packageModule.escapeHtml('<script>alert("1")</script>'));
// returns <script>alert("1")</script>
console.log(packageModule.unescapeHtml('<script>alert("1")</script>'));
// returns <script>alert("1")</script>
```
**GitHub:** https://github.com/ram170/escape-unescape-html <br/>
**NPM package:** https://www.npmjs.com/package/escape-unescape-html-characters
<br/>
**Release Notes:** <br/>
**v0.0.1** - Initial commit and doesn't provide support to few symbols(" and ') while escaping. This can be used if you only want to escape < and > <br/>
**v0.1.0** - Provided support for those symbols and added Readme. <br/>