Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xss

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xss - npm Package Compare versions

Comparing version 0.2.13 to 0.2.14

24

package.json
{
"name": "xss",
"main": "./lib/index.js",
"version": "0.2.13",
"version": "0.2.14",
"description": "Sanitize untrusted HTML (to prevent XSS) with a configuration specified by a Whitelist",

@@ -25,8 +25,13 @@ "author": "leizongmin <leizongmin@gmail.com> (http://ucdok.com)",

"devDependencies": {
"blanket": "^1.2.1",
"browserify": "^12.0.1",
"coveralls": "^2.11.9",
"debug": "^2.2.0",
"istanbul": "^0.4.3",
"mocha": "^2.3.4",
"uglify-js": "^2.6.1"
},
"files": [
"lib",
"bin/xss"
],
"bin": {

@@ -36,18 +41,7 @@ "xss": "./bin/xss"

"scripts": {
"coverage": "./node_modules/mocha/bin/mocha --require blanket -R html-cov > coverage.html -t 5000 && open coverage.html",
"test": "export DEBUG=xss:* && ./node_modules/mocha/bin/mocha -t 5000",
"test": "export DEBUG=xss:* && mocha -t 5000",
"test-cov": "export DEBUG=xss:* && istanbul cover _mocha --report lcovonly -- -t 5000 -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
"build": "./bin/build",
"prepublish": "npm run test && npm run build"
},
"config": {
"blanket": {
"pattern": [
""
],
"data-cover-never": [
"node_modules",
"test"
]
}
},
"licenses": [

@@ -54,0 +48,0 @@ {

@@ -24,2 +24,3 @@ [![NPM version][npm-image]][npm-url]

Sanitize untrusted HTML (to prevent XSS) with a configuration specified by a Whitelist.

@@ -41,3 +42,2 @@ ======

---------------

@@ -67,5 +67,6 @@

## Unit Test
## They are using xss module
Run `npm test` command in the source directary.
+ **nodeclub** - A Node.js bbs using MongoDB - https://github.com/cnodejs/nodeclub
+ **cnpmjs.org** - Private npm registry and web for Enterprise - https://github.com/cnpm/cnpmjs.org

@@ -291,2 +292,21 @@

### Customize CSS filter
If you allow the attribute `style`, the value will be processed by [cssfilter](https://github.com/leizongmin/js-css-filter) module. The cssfilter module includes a default css whitelist. You can specify the options for cssfilter module like this:
```javascript
myxss = new xss.FilterXSS({
css: {
whiteList: {
position: /^fixed|relative$/,
top: true,
left: true,
}
}
});
html = myxss.process('<script>alert("xss");</script>');
```
For more help, please see https://github.com/leizongmin/js-css-filter
### Quick Start

@@ -379,3 +399,3 @@

```
```html
<div a="1" b="2" data-a="3" data-b="4">hello</div>

@@ -404,3 +424,3 @@ convert to:

```
```html
<x><x-1>he<x-2 checked></x-2>wwww</x-1><a>

@@ -433,3 +453,3 @@ convert to:

```
```html
image list:

@@ -455,3 +475,3 @@ img1, img2, img3, img4

```
```html
text: helloend

@@ -458,0 +478,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc