You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.3 KiB

4 years ago
  1. # entities [![NPM version](http://img.shields.io/npm/v/entities.svg)](https://npmjs.org/package/entities) [![Downloads](https://img.shields.io/npm/dm/entities.svg)](https://npmjs.org/package/entities) [![Build Status](http://img.shields.io/travis/fb55/entities.svg)](http://travis-ci.org/fb55/entities) [![Coverage](http://img.shields.io/coveralls/fb55/entities.svg)](https://coveralls.io/r/fb55/entities)
  2. En- & decoder for XML/HTML entities.
  3. ## How to…
  4. ### …install `entities`
  5. npm i entities
  6. ### …use `entities`
  7. ```javascript
  8. const entities = require("entities");
  9. //encoding
  10. entities.escape("&"); // "&"
  11. entities.encodeXML("&"); // "&"
  12. entities.encodeHTML("&"); // "&"
  13. //decoding
  14. entities.decodeXML("asdf & ÿ ü '"); // "asdf & ÿ ü '"
  15. entities.decodeHTML("asdf & ÿ ü '"); // "asdf & ÿ ü '"
  16. ```
  17. ---
  18. License: BSD-2-Clause
  19. [Get supported entities with the Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-entities?utm_source=npm-entities&utm_medium=referral&utm_campaign=readme)
  20. ## Security contact information
  21. To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
  22. Tidelift will coordinate the fix and disclosure.