28 lines
923 B
Markdown
28 lines
923 B
Markdown
![]() |
#entities [](https://npmjs.org/package/entities) [](https://npmjs.org/package/entities) [](http://travis-ci.org/fb55/node-entities) [](https://coveralls.io/r/fb55/node-entities)
|
||
|
|
||
|
En- & decoder for XML/HTML entities.
|
||
|
|
||
|
##How to…
|
||
|
|
||
|
###…install `entities`
|
||
|
|
||
|
npm i entities
|
||
|
|
||
|
###…use `entities`
|
||
|
|
||
|
```javascript
|
||
|
var entities = require("entities");
|
||
|
//encoding
|
||
|
entities.encodeXML("&"); // "&"
|
||
|
entities.encodeHTML("&"); // "&"
|
||
|
//decoding
|
||
|
entities.decodeXML("asdf & ÿ ü '"); // "asdf & ÿ ü '"
|
||
|
entities.decodeHTML("asdf & ÿ ü '"); // "asdf & ÿ ü '"
|
||
|
```
|
||
|
|
||
|
<!-- TODO extend API -->
|
||
|
|
||
|
---
|
||
|
|
||
|
License: BSD-like
|