Code Monkey home page Code Monkey logo

simplehar's Introduction

Simple Har

Har viewer made simple

Build Status

Getting Started

This viewer can be used within a server and accessing index.html in your browser or you can use it as a node app.

You can also access rafacesar.github.io/simplehar and use it online!
To understand how the information is displayed, check the explanation.

The viewer needs Bootstrap(+3.0.0) and jQuery(+2.1.0) to work.

To install it as a node module you can run:

npm install simplehar

Or globally:

npm install -g simplehar

Using as a dependency/programmatically

var simplehar = require('simplehar'),
	path = require('path'),
	harFile = path.join('harFolder', 'myHarFile.har'),
	htmlFile = path.join('htmlFolder', 'myHtmlFile.html');

simplehar({
	har:harFile,
	html:htmlFile,
	lng:false
});


//<style>...</style>...html...<script>...</script>
var result = simplehar({
	har:harFile,
	html:htmlFile,
	lng:false,
	frame:true,
	return:true
});


//[
//	<style>...</style>...html...<script>...</script>,
//	<style>...</style>...html...<script>...</script>
//]
var result = simplehar({
	har:multipleSitesHarFile,
	lng:false,
	frame:true,
	return:true
});


//{
//	css:'...',
//	js:'...',
//	html:'...'
//}
var result = simplehar({
	har:harFile,
	html:htmlFile,
	lng:false,
	frame:true,
	return:true,
	frameContent:{
		css:false,
		js:false
	}
});

//{
//	css:'...',
//	js:'...',
//	html:['...', '...']
//}
var result = simplehar({
	har:multipleSitesHarFile,
	lng:false,
	frame:true,
	return:true,
	frameContent:{
		css:false,
		js:false
	}
});

Using command line

After installed you can simply run:

node ./node_module/.bin/simplehar <harFile>

Or:

node ./node_module/.bin/simplehar <harFile> <htmlFile>

Or a complete command:

node ./node_module/.bin/simplehar <htmlFile> <harFile> lng=pt-BR frame

Or globally:

simplehar <harFile>

Parameters

harFile (Required)

Har source to be used as base (it needs the .har extension)

htmlFile (Optional)

Html file to be generate with the har informations (it needs the .html extension) Via Command Line:

This parameter will be ignored when using multiple sites in one harFile

Via Programmatically (when using multiple sites)

The string {id} will be replaced by the id of the page on harFile. If the {id} is missing, this parameter will be ignored

frame (Optional)

This option genarate a html file just with the div content, embedding the CSS and JS necessary to viewer work.

This options is good for embedding the html in another page. But the page must already have bootstrap and jQuery loaded.

lng (Optional)

Language used to translate (from src/translate.json) (e.g pt-BR)

frameContent (Optional - Used only as dependency/programmatically)

Object specifying if the html should have JS or CSS inline

simplehar's People

Contributors

rafacesar avatar patrickkettner avatar soulgalore avatar

Watchers

James Cloos avatar Andy Mok avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.