Fork自 GitCode / 帮助文档
体验新版 GitCode,发现更多精彩内容 >>
# 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) En- & decoder for XML/HTML entities. ## How to… ### …install `entities` npm i entities ### …use `entities` ```javascript var entities = require("entities"); //encoding entities.encodeXML("&"); // "&#38;" entities.encodeHTML("&"); // "&#38;" //decoding entities.decodeXML("asdf & ÿ ü '"); // "asdf & ÿ ü '" entities.decodeHTML("asdf & ÿ ü '"); // "asdf & ÿ ü '" ``` <!-- TODO extend API --> --- License: BSD-2-Clause