1.0.1 • Published 1 year ago

@chribur_/strict-sanitizer v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@chribur_/strict-sanitizer

A Node package of STRICT sanitizer for XSS. It removes all ASCII symbols from the inputted text. If you want, you can make it remove the line break codes or the whitespaces.

Install

$ npm i -D @chribur_/strict-sanitizer

How to use

const text = 'Hello world!\nこんにちは、世界!'

const strictSanitizer = new StrictSanitizer('noLineBreakAndNoSpace'); // The default parameter is ''.
const sanitizedText = strictSanitizer.sanitize(text); // 'Helloworldこんにちは、世界!'

The StrictSanitizer accepts only three parameters:

  • 'noLineBreakAndNoSpace': This also removes the whitespaces and the line break codes.
  • 'noLineBreak': This also removes the line break codes.
  • '' (the dafault parameter): This doesn't remove the whitespaces and the line break codes.

License

MIT License

1.0.1

1 year ago

1.0.0

1 year ago