@favware/unescapedeprecated

Convert HTML entities to HTML characters, e.g. `>` converts to `>`.

Usage no npm install needed!

<script type="module">
  import favwareUnescape from 'https://cdn.skypack.dev/@favware/unescape';
</script>

README

DEPRECATED

Work on this package has stopped in favor of confusables from developer gc, a package which I have also contributed to and has a much better feature set and far better performance


logo

@favware/unescape

Convert HTML entities to HTML characters, e.g. > converts to >.


Project Status

GitHub Codecov

Bundle Sizes

npm bundle size npm bundle size npm

Social Media and Donations

Join Discord server Twitter Follow Patreon Donate PayPal Donate


Easily unescape HTML entities in both the backend and the frontend

Key Features

  • Useable in NodeJS through package manager of choice
  • Typesafe
  • Bundled with Rollup for maximum size reduction (only 1kB minified + gzipped!), ES module support and browser support
  • Generated TypeScript declarations
  • Treeshakeable in Webpack

Install

Install with yarn or npm:

yarn add @favware/unescape

# npm install @favware/unescape

Usage

const { unescape, charSets } = require('@favware/unescape');
// import unescape, { charSets } from '@favware/unescape';

const text = '&lt;div&gt;unescaped&lt;/div&gt;';

console.log(unescape('&lt;div&gt;abc&lt;/div&gt;'));
console.log(unescape`&lt;div&gt;abc&lt;/div&gt;`);
console.log(unescape`awesome text with some ${text} section`);

// Log the supported characters
console.log(charSets);

API Documentation