Nuclear Power Manager

    gulp-angular-xss

    0.2.4 • Public • Published

    gulp-angular-xss

    Anti-xss gulp plugin for angular. Optionally prohibits the use of ng-bind-html.

    First install gulp-angular-xss

    npm install --save-dev gulp-angular-xss

    Usage:

    var xss = require('gulp-angular-xss');
     
    gulp.src('invalid.html')
        .pipe(xss());

    Options:

    gulp.task('invalidWithExceptionAndFilter', function () {
        gulp.src('invalid.html')
            .pipe(xss({
                // treat matches as error
                error: false,
                // filter out based on file path and value
                exceptions: [
                    // ng-bind-html="badXss" from invalid.html will be filtered out
                    {path: "invalid.html", value: "badXss"}
                ],
                // filter out based on filter value
                supportedFilters: [
                    // attributes like ng-bind-html="something | myfilter: something" will be filtered out
                    "myfilter"
                ]
            }));
    });

    Install

    npm i gulp-angular-xss

    DownloadsWeekly Downloads

    16

    Version

    0.2.4

    License

    MIT

    Last publish

    Collaborators

    • kazhu
    • mgabor