Decode named character references.
- What is this?
- When should I use this?
- Install
- Use
- API
- Types
- Compatibility
- Security
- Related
- Contribute
- License
A workaround for webpack.
Never use this.
Use parse-entities
.
It uses this.
This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:
npm install decode-named-character-reference
In Deno with esm.sh
:
import {decodeNamedCharacterReference} from 'https://esm.sh/decode-named-character-reference@1'
In browsers with esm.sh
:
<script type="module">
import {decodeNamedCharacterReference} from 'https://esm.sh/decode-named-character-reference@1?bundle'
</script>
import {decodeNamedCharacterReference} from 'decode-named-character-reference'
decodeNamedCharacterReference('amp') //=> '&'
This package exports the identifier decodeNamedCharacterReference
.
There is no default export.
Again, use parse-entities
.
This package is fully typed with TypeScript. It exports no additional types.
This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. It also works in Deno and modern browsers.
This package is safe.
parse-entities
— parse (decode) HTML character references
Yes please! See How to Contribute to Open Source.