Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Issue #145 #148

Merged
merged 2 commits into from
Nov 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "pagespeed",
"name": "performance",
"version": "1.0.0",
"description": "",
"main": "index.js",
"main": "pagespeed.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
Expand All @@ -12,6 +12,7 @@
"commander": "^2.9.0",
"fs-extra": "^0.26.2",
"json-pretty": "0.0.1",
"psi": "^1.0.6"
"psi": "^1.0.6",
"shelljs": "^0.5.3"
}
}
15 changes: 0 additions & 15 deletions performance/pagespeed/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ program
.version('0.0.1')
.option('-u, --url [url]', 'input url')
.option('-d, --destination [path]', 'input path to store the output')
.option('-s, --strategy [mobile/desktop]', 'input the strategy to use when analyzing the page (default : desktop)')
.parse(process.argv);

var url = program.url;
var dest = program.destination || '';
var strategy = program.strategy || 'desktop';
var strategy = 'desktop';

var option = {
strategy : strategy
Expand All @@ -27,7 +26,7 @@ fs.exists(program.destination, function (exists) {
psi(url , option , function (err, data) {
var toJson = jsonPretty(data);

fs.writeFile(dest + 'resultPagespeed.json', toJson, function (err) {
fs.writeFile(dest + 'resultPagespeedDesktop.json', toJson, function (err) {
if (err) throw err;
console.log('It\'s saved!');
});
Expand Down
34 changes: 34 additions & 0 deletions performance/pagespeedMobile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
var psi = require('psi'),
fs = require('fs-extra'),
jsonPretty = require('json-pretty'),
program = require('commander');

program
.version('0.0.1')
.option('-u, --url [url]', 'input url')
.option('-d, --destination [path]', 'input path to store the output')
.parse(process.argv);

var url = program.url;
var dest = program.destination || '';
var strategy = 'mobile';

var option = {
strategy : strategy
};

fs.exists(program.destination, function (exists) {
if ( !exists ) {
fs.mkdirsSync( program.destination );
}
dest = './' + program.destination;

psi(url , option , function (err, data) {
var toJson = jsonPretty(data);

fs.writeFile(dest + 'resultPagespeedMobile.json', toJson, function (err) {
if (err) throw err;
console.log('It\'s saved!');
});
});
});
File renamed without changes.
14 changes: 0 additions & 14 deletions performance/yslow/README.md

This file was deleted.

19 changes: 0 additions & 19 deletions performance/yslow/package.json

This file was deleted.

File renamed without changes.