FrankJS

| page performance reports
FrankJS
FrankJS is a node.js script used to create web page reports such as DOM ready time, pageload and page resources based on information provided by one PhantomJS script.
Install with npm:
$ npm install -g frankjs

Usage:
$ node frankjs [your URL]

Getting started

FrankJS usage is simple, you just need to run $ node frankjs google.com and it will generate one html report in report-results folder.
Behind the scenes FrankJS is using one PhantomJS script to get all the page information and after that it creates your report using Jade Template engine.

Example:
> node frankjs google.com
Report created with success:
result-default-1386976982564.html

Result file:
Results for http://google.com
Started at 12/13/2013 11:23:04
Page loaded in 2219 ms
DOM ready in 24 ms
Window load in 1311 ms
201 DOM elements
Page errors....
Console messages....
Resources...
Cookies...

Options

FrankJS supports custom created reports and also custom scripts to run in PhantomJS, you can override options using extra parameters in command line (for more information: node frankjs -h) or you can edit FrankJS default options.

Default options are located in default.json in config-files folder, you can override any default option or create your custom config file for a specific report. To load your json config file use -ff=FILENAME option (must be in config-files folder). Any attribute in json config file will be mapped in frankArgs object, just in case you want to add any awesome new functionality.

Reports

Custom reports

Custom reports can be used to hide some information that is not required for your report or if you are using a custom PhantomJS script to get page metrics. Reports are created using Jade template engine and must be in report-templates folder. Each template should recieve one JSON result so you can iterate in report file.

Examples:
Creating load time report using FrankJS default script (load-time-only.txt)
h1 Load time results for:
= ' ' + result.address

p
| Page loaded in
= result.loadTime + ' ms'
Usage: $node frankjs google.com -rt=load-time-only

Creating load time report using YSlow script based on YSlow JSON output (yslow.txt)
h1 Load time results for:
= ' ' + result.u

p
| Page loaded in
= result.lt + ' ms'
Usage: $ node frankjs google.com -cs=yslow -rt=yslow -csp=--info basic

Multiple reports

You can create multiple reports using one result set, -rt option is comma-delimited and all results are in the same SET ID. Example:
> node frankjs google.com -rt=result-default,my-custom-report
Report created with success:
result-default-1386976982564.html
result-my-custom-report-1386976982564.html

PhantomJS script

FrankJS has its own PhantonJS script to get metrics but you can also use your custom script (i.e. YSlow) to get any other data to create a report. Your custom script must be in phantomjs-scripts folder and must return one valid stringified JSON (You also need one custom report to handle the result JSON).

YSlow reports

FrankJS 0.6 has YSlow script and report package, you can run report using:
> node frankjs google.com -rt=yslow -cs=yslow -csp=--dict

Contribute

FrankJS is an open source project and contributions are essential to its growth and success.
Here are just a few ways you can get started:
- Fork me on github
- Feature request
- Report a bug
© Copyright 2013 Mauricio Adams.