1.0.1 • Published 5 years ago

screenshotcap v1.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

Screenshotcap

Simple and straightforward NPM package that calls screenshotlayer webpage capture / screenshot service.

Screenshotcap will accept an url and saves the captured screen onto a directory you have specified.

Installation

npm install screenshotcap [--save]

Before you use this library

Screenshotcap is a API wrapper against the Screenshotcap service.

In order to start using the service, you will need to sign up for an account at ScreenShotLayer.com. After you have registered for an account, you will need to get the API access key from the Dashboard and also fill up the secret key.

Usage for Capture

const screenshotcap = require('screenshotcap');

const opts = {
    url: 'https://twitter.com/AlvinLoh19', // The URL to capture
    pathtowrite: '/some/path/with/filename.png' // The filepath with file name to write to
    accesskey: 'YOUR API ACCESS KEY',
    secretkey: 'YOUR API SECRET KEY',
    viewport: '1400x900' // Optional parameter, will default to 1400x900
};

screenshotcap(opts).then(function(done){
   console.log('Done writing file'); 
});

Things to note

Currently, the library only supports writing to PNG files.