吕君喜 406d880ac6 first | il y a 3 ans | |
---|---|---|
.. | ||
lib | il y a 3 ans | |
maps | il y a 3 ans | |
test | il y a 3 ans | |
.travis.yml | il y a 3 ans | |
LICENSE | il y a 3 ans | |
index.js | il y a 3 ans | |
package.json | il y a 3 ans | |
readme.md | il y a 3 ans |
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