gulp-har

1.0.6 • Public • Published

Installation

$ npm install gulp-har

Example usage of gulp-har:

import gulp_har from 'gulp-har';
import gulp from 'gulp';

gulp.task('parse', (done) => {
    gulp.src("./har/*.har")
        .pipe(gulp_har({
            beautify: ["!.json"],
            override: ["!.json"],
            request: {
                filter: {
                    url: (request, url) => /^(?!(.*?blob\/master)).*/.test(url),
                }
            },
            response: {
                filter: {
                    "status": /^[^45]\d+/,
                    "content.text": (request, text) => !!text && !!text.trim()
                }
            }
        }))
        .pipe(gulp.dest("./dest"));
    done();
});

gulp.task("default", gulp.series("parse"));

defaults per options

let options = {
    override: true,
    beautify: true,
    mimeType: {
        "application/x-javascript": {
            "extensions": ["js", "mjs"]
        }
    },
    request: {
        filter: {
        },
        queryString: {
            remove: true,
            toPath: true
        }
    },
    response: {
        filter: {
            "status": /^[^45]\d+/,
            "content.text": (request, text) => !!text && !!text.trim()
        },
        content: {
            removeHostname: true
        }
    },
    output: {
        defaultExt: "txt",
        dirPath: 'output',
        pathLengthLimit: 150
    },
    apiInfo: {
        saved: true,
        fileName: 'apis.json',
        filter: /(REST|api)\//
    }
 }

/gulp-har/

    Package Sidebar

    Install

    npm i gulp-har

    Weekly Downloads

    1

    Version

    1.0.6

    License

    MIT

    Unpacked Size

    25.1 kB

    Total Files

    10

    Last publish

    Collaborators

    • rayple