anti_xss

1.0.1 • Public • Published

How to use:

this module is best suited for component based front-end frameworks it is best used inside of a lifecycle hook such as in the example below


import antiXss from 'anti_xss';

//call the module function inside of a component lifecycle hook :)

  componentDidMount(){
    let escapeChars = ['<script>','<SCRIPT>','<Script>','%']
    let whiteListURLS = ['http://goodurl','https://greaturl','https://supersafeurl']
        antiXss.isSafe("app",escapeChars,whiteListURLS)
  }

parameters

params description
"app" ID of the parent node
escapeChars characters not allowed in nodes
whiteListURLS array of allowed URLS

Readme

Keywords

none

Package Sidebar

Install

npm i anti_xss

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

2.69 kB

Total Files

3

Last publish

Collaborators

  • robindood