Skip to content

ram170/escape-unescape-html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm npm bundle size (version)

Thanks for checking out the package.

USAGE:

Add the package to your project by using:

npm i escape-unescape-html-characters

Import the package wherever you need and use it like this:

const packageModule = require('escape-unescape-html-characters');

console.log(packageModule.escapeHtml('<script>alert("1")</script>'));
// returns &lt;script&gt;alert(&quot;1&quot;)&lt;/script&gt;

console.log(packageModule.unescapeHtml('&lt;script&gt;alert(&quot;1&quot;)&lt;/script&gt;'));
// returns <script>alert("1")</script>

GitHub: https://github.com/ram170/escape-unescape-html
NPM package: https://www.npmjs.com/package/escape-unescape-html-characters


**Release Notes:**

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 >
v0.1.0 - Provided support for those symbols and added Readme.

About

A package to escape and unescape html characters.

Resources

License

Stars

Watchers

Forks

Packages

No packages published