@sanitise/html
v0.1.1
Published
🧼 Sanitise HTML and XML from an input
Downloads
7
Readme
@sanitise/html
🧼 Sanitise HTML and XML from an input
Requirements
This module requires an Active LTS Node version (v14.15.0+).
Install
Using npm:
npm install @sanitise/html
Usage
const { sanitise } = require('@sanitise/html');
sanitise('<div>batman</div>');
// → 'batman'
Falsey Results
This package follows the behavior of JSON.stringify
. The following results for falsey values can be expected:
sanitise(undefined);
// → undefined
sanitise(null);
// → 'null'
sanitise('');
// → ''
sanitise(false);
// → 'false'