Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gpagespeed

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gpagespeed - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

10

cli.js

@@ -15,7 +15,7 @@ #!/usr/bin/env node

console.log('Usage:');
console.log(' $ gpagespeed --url=<url> --key=<key>');
console.log(' $ gpagespeed <url> --key=<key>');
console.log('');
console.log('Optional, supply other arguments.');
console.log('See https://developers.google.com/speed/docs/insights/v1/getting_started for description');
console.log(' $ gpagespeed --url=<url> --key=<key> --callback=<callback> --prettyprint=<true> --userIp=<userIp> --locale=<locale> --strategy=<desktop|mobile>');
console.log(' $ gpagespeed <url> --key=<key> --callback=<callback> --prettyprint=<true> --userIp=<userIp> --locale=<locale> --strategy=<desktop|mobile>');
}

@@ -33,3 +33,7 @@

if(!argv.url || (!argv.key && !argv.nokey)){
if (query.indexOf('http') !== -1) {
opts.url = argv._[0];
}
if(!opts.url || (!argv.key && !argv.nokey)){
printHelp();

@@ -36,0 +40,0 @@ return;

var request = require('request')
, pagespeedUrl = 'https://www.googleapis.com/pagespeedonline/v1/runPagespeed';
, validUrl = require('valid-url')
, pagespeedUrl = 'https://www.googleapis.com/pagespeedonline/v1/runPagespeed'
;
module.exports = function(opts, callback){
if(!opts.key && !opts.nokey){
return callback(new Error('Missing required param: key'), null);
}
if(!opts.url){

@@ -12,2 +16,6 @@ return callback(new Error('Missing required param: url'), null);

if(opts.url && !validUrl.isWebUri(opts.url)){
return callback(new Error('Invalid url'), null);
}
request(pagespeedUrl,{qs:opts}, function(error, res, body){

@@ -14,0 +22,0 @@ if(error){

{
"name": "gpagespeed",
"description": "Analyze a webpage with Google PageSpeed",
"version": "0.0.5",
"version": "0.0.6",
"author": {
"name": "Geir Gåsodden",
"email": "geir.gasodden@pythonia.no"
"email": "geir.gasodden@pythonia.no",
"url": "https://github.com/zrrrzzt"
},

@@ -17,3 +18,3 @@ "main": "index.js",

"scripts": {
"test": "mocha test/test.js --timeout 10s"
"test": "mocha --reporter spec test/*.js --timeout 10s"
},

@@ -32,8 +33,9 @@ "files": [

"dependencies": {
"request": "^2.34.0",
"minimist": "0.0.8"
"minimist": "^0.1.0",
"request": "^2.36.0",
"valid-url": "^1.0.9"
},
"devDependencies": {
"mocha": "^1.18.2"
"mocha": "^1.20.0"
}
}

@@ -53,3 +53,3 @@ #gpagespeed [![Build Status](https://travis-ci.org/zrrrzzt/gpagespeed.svg?branch=master)](https://travis-ci.org/zrrrzzt/gpagespeed)

```
$ gpagespeed --url=<url> --key=<key>
$ gpagespeed <url> --key=<key>
```

@@ -60,3 +60,3 @@

```
$ gpagespeed --url=<url> --key=<key> --callback=<callback> --prettyprint=<true> --userIp=<userIp> --locale=<locale> --strategy=<desktop|mobile>
$ gpagespeed <url> --key=<key> --callback=<callback> --prettyprint=<true> --userIp=<userIp> --locale=<locale> --strategy=<desktop|mobile>
```

@@ -63,0 +63,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc