Package Exports
- @locustjs/htmlencode
- @locustjs/htmlencode/index.cjs.js
- @locustjs/htmlencode/index.esm.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@locustjs/htmlencode) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
locustjs-htmlencode
This library provides htmlencode/htmldecode functions.
Install
npm i @locustjs/htmlencodeImport
CommonJs
var { htmlEncode } = require('@locustjs/htmlencode');ES6
import { htmlEncode } from '@locustjs/htmlencode'Usage
Example 1: htmlEncode
import { htmlEncode } from '@locustjs/htmlencode'
const str = '<p>Plan & Business = $</p>';
console.log(htmlEncode(str)); // <p>Plan & Business = $</p>Example 2: htmlEncode + custom ignore character list
import { htmlEncode } from '@locustjs/htmlencode'
const str = '<p>Plan & Business = $</p>';
console.log(htmlEncode(str, ['/', '=', '$'])); // <p>Plan & Business = $</p>Example 3: htmlDecode
import { htmlDecode } from '@locustjs/htmlencode'
const str = '<p>Plan & Business</p>';
console.log(htmlDecode(str)); // <p>Plan & Business</p>