How to use psi - 10 common examples

To help you get started, we’ve selected a few psi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github koljakutschera / yafbp / gulpfile.js View on Github external
_.each(dataPages, function (value, key, list) {

				console.log('Awaiting psi-report for: ' + url + '/' + key +'.html');

				psi.output(url + '/' + key +'.html',{
					nokey: 'true', // or use key: ‘YOUR_API_KEY’
					strategy: 'desktop',
				}).then(() => {
					
					psi.output(url + '/' + key +'.html',{
						nokey: 'true', // or use key: ‘YOUR_API_KEY’
						strategy: 'mobile',
					});
				});
			});
		}
github GoogleChromeLabs / airhorn / gulpfile.js View on Github external
// Note: this uses an unsigned certificate which on first access
    //       will present a certificate warning in the browser.
    // https: true,
    server: 'dist',
    baseDir: "dist"
  });
});

// Build Production Files, the Default Task
gulp.task('default', ['clean'], function(cb) {
  runSequence('styles', ['html', 'scripts', 'styles', 'images', 'fonts', 'sounds', 'copy', 'copy-workerscripts'], cb);
});

// Run PageSpeed Insights
// Update `url` below to the public URL for your site
gulp.task('pagespeed', pagespeed.bind(null, {
  // By default, we use the PageSpeed Insights
  // free (no API key) tier. You can use a Google
  // Developer API key if you have one. See
  // http://goo.gl/RkN0vE for info key: 'YOUR_API_KEY'
  url: 'https://example.com',
  strategy: 'mobile'
}));

// Load custom tasks from the `tasks` directory
// try { require('require-dir')('tasks'); } catch (err) { console.error(err); }
github fusionstrings / project-fusion / gulp / tasks / pagespeed.js View on Github external
gulp.task('pagespeed', cb => {
  // Update the below URL to the public URL of your site
  pagespeed('example.com', {
    strategy: 'mobile',
    // By default we use the PageSpeed Insights free (no API key) tier.
    // Use a Google Developer API key if you have one: http://goo.gl/RkN0vE
    // key: 'YOUR_API_KEY'
  }, cb);
});
github dstroot / skeleton / gulpfile.js View on Github external
gulp.task('desktop', ['mobile'], function (cb) {
  // output a formatted report to the terminal
  psi.output(site, {
    strategy: 'desktop',
    locale: 'en_US',
    threshold: 80
  }, cb);
});
github Tempurturtul / udacity-fend-projects / fend-resume / gulpfile.js View on Github external
gulp.task('psi:desktop', ['serve:tunnelled'], function() {
  var site = browserSync.instance.tunnel.url;
  // Ensure http protocol is used to avoid breaking resources.
  site = site.replace(/^https?/, 'http');
  // Add user-defined path.
  site = site + (psiPath || '');

  return psi.output(site, {
    nokey: 'true',
    strategy: 'desktop',
    threshold: 1  // Prevents error if score is below default of 70.
  });
});
github dsebastien / midnightLightV2 / gulp / tasks / pagespeed.js View on Github external
gulp.task('pagespeed', 'Run PageSpeed Insights', (cb) =>{
	// Update the below URL to the public URL of your site
	pagespeed.output(packageJSON.homepage, {
		strategy: 'mobile' // desktop

		// Use the PageSpeed Insights free (no API key) tier.
		// Use a Google Developer API key if you have one: http://goo.gl/RkN0vE
		// key: 'API_KEY'
	}, cb);
});
github WPKitIO / WPKit / gulpfile.js View on Github external
gulp.task('pagespeed', function (cb) {
  // Update the below URL to the public URL of your site
  pagespeed.output('example.com', {
    strategy: 'mobile',
    // By default we use the PageSpeed Insights free (no API key) tier.
    // Use a Google Developer API key if you have one: http://goo.gl/RkN0vE
    // key: 'YOUR_API_KEY'
  }, cb);
});
github Tempurturtul / udacity-fend-projects / fend-design-patterns / cat-clicker-v1 / gulpfile.js View on Github external
gulp.task('psi:mobile', ['serve:tunnelled'], function() {
  var site = browserSync.instance.tunnel.url;
  // Ensure http protocol is used to avoid breaking resources.
  site = site.replace(/^https?/, 'http');
  // Add user-defined path.
  site = site + (psiPath || '');

  return psi.output(site, {
    nokey: 'true',
    strategy: 'mobile',
    threshold: 1  // Prevents error if score is below default of 70.
  });
});
github mikelambert / dancedeets-monorepo / server / gulpfile.babel.js View on Github external
gulp.task('pagespeed', cb =>
  // Update the below URL to the public URL of your site
  pagespeed(
    'https://www.dancedeets.com/new_homepage',
    {
      strategy: 'mobile',
      // By default we use the PageSpeed Insights free (no API key) tier.
      // Use a Google Developer API key if you have one: http://goo.gl/RkN0vE
      // key: 'YOUR_API_KEY'
    },
    cb
  )
);
github tastejs / todomvc / gulpfile.js View on Github external
// CSS and JS.
		.pipe($.vulcanize({ dest: 'dist', strip: true }))
		.pipe($.size({title: 'html'}));
});

// Clean Output Directory
gulp.task('clean', del.bind(null, ['.tmp', 'dist']));

// Build Production Files, the Default Task
gulp.task('default', ['clean'], function (cb) {
	runSequence(['styles', 'copy'], ['jshint', 'html', 'images'], cb);
});

// Run PageSpeed Insights
// Update `url` below to the public URL for your site
gulp.task('pagespeed', pagespeed.bind(null, {
	// By default, we use the PageSpeed Insights
	// free (no API key) tier. You can use a Google
	// Developer API key if you have one. See
	// http://goo.gl/RkN0vE for info key: 'YOUR_API_KEY'
	url: 'https://todomvc.com',
	strategy: 'mobile'
}));

gulp.task('serve', function (cb) {
	app.listen(8080, cb);
});

gulp.task('test-server', function (cb) {
	app.listen(8000, cb);
});

psi

PageSpeed Insights with reporting

Apache-2.0
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis

Popular psi functions