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

pssg

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pssg

Node client for Google Screenshot API

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

pssg

Description

pssg:

  • stands for "pagespeed screengrab".
  • is a node client for Google's "secret" screenshot API
  • helps you rapidly generate thumbnails, like Urlbox (but free and lower quality) or PhantomJS (but faster and lower quality)

Usage

First, install pssg:

npm install pssg --save-dev

Then call download or base64:

var pssg = require('pssg');

var filename = 'yeezy_screengrab';
pssg.download('http://www.kanyewest.com', {
  dest: __dirname,
  filename: filename
}).then(function(file) {
  console.log('Saved to ' + file + '.');
});

pssg.base64('http://randallma.com')
  .then(function(b64) {
    console.log('Screenshot base64 snippet: ' + b64.substr(0, 20));
  });

That's it!

API

pssg.download(url, opts)

Save a screengrab to disk. Returns a promise, from which you can get the final path to the image.

pssg.base64(url)

Fetch the screenshot but don't save it to disk. Returns a promise, from which you can get the base64 encoded image.

opts

dest - Only used with pssg.download. String path to the desired directory in which to save the screengrab.

filename - Only used with pssg.download. Desired filename for the screengrab. .jpg extension will automatically be concatenated.

mobile - Boolean, defaults to false. Set to true to request mobile screengrab of page.

License

MIT

Keywords

FAQs

Package last updated on 05 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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