|
|
3 年 前 | |
|---|---|---|
| .. | ||
| lib | 3 年 前 | |
| maps | 3 年 前 | |
| test | 3 年 前 | |
| .travis.yml | 3 年 前 | |
| LICENSE | 3 年 前 | |
| index.js | 3 年 前 | |
| package.json | 3 年 前 | |
| readme.md | 3 年 前 | |
En- & decoder for XML/HTML entities.
####Features:
U)##How to…
###…install entities
npm i entities
###…use entities
//encoding
require("entities").encode(<str> data[, <int> level]);
//decoding
require("entities").decode(<str> data[, <int> level]);
The level attribute indicates what level of entities should be decoded (0 = XML, 1 = HTML4 and 2 = HTML5). The default is 0 (read: XML).
There are also methods to access the level directly. Just append the name of the level to the action and you're ready to go (e.g. encodeHTML4(data), decodeXML(data)).
License: BSD-like