cs142/project3/node_modules/entities
2020-08-01 19:26:11 -03:00
..
lib added old data 2020-08-01 19:26:11 -03:00
maps added old data 2020-08-01 19:26:11 -03:00
test added old data 2020-08-01 19:26:11 -03:00
.travis.yml added old data 2020-08-01 19:26:11 -03:00
index.js added old data 2020-08-01 19:26:11 -03:00
LICENSE added old data 2020-08-01 19:26:11 -03:00
package.json added old data 2020-08-01 19:26:11 -03:00
readme.md added old data 2020-08-01 19:26:11 -03:00

#entities NPM version Downloads Build Status Coverage

En- & decoder for XML/HTML entities.

####Features:

  • Focussed on speed
  • Supports three levels of entities: XML, HTML4 & HTML5
    • Supports char code entities (eg. 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