1.3.6 • Published 6 years ago

node-proshot v1.3.6

Weekly downloads
14
License
MIT
Repository
github
Last release
6 years ago

node-proshot

Handy tool to capture website screenshots using Puppeteer.

Installation

$ npm install node-proshot

Usage

const proshot = require('node-proshot');

Take a screenshot for a website

proshot.screenshot(URL, FILE_NAME_TO_SAVE, CONFIG);

The CONFIG have following properties:

  • timeout: duration to wait for AJAX loading to complete. Default to 5000 milliseconds.
  • viewport {width, height}: the viewport to take screenshot. Default: 1280x720.

For examples:

proshot.screenshot('https://petehouston.com', 'petehouston.com.png', { 
    viewport: { 
        width: 1920,
        height: 1080
    },
    timeout: 2000 
});

proshot.screenshot('https://petehouston.com', 'petehouston.com.png', { timeout: 2000 });

proshot.screenshot('https://moso.com', 'moso.com.jpg');

Take screenshots for multiple websites at a time

proshot.multishot(URL_ARRAY, DIRECTORY_TO_SAVE, CONFIG);
  • URL_ARRAY : the array of websites, should start with either http or https.
  • DIRECTORY_TO_SAVE: this should be the folder where screenshots are stored. Default: directory where script is executed.
  • CONFIG: have following properties:
    • viewport: viewport to take screenshots. Default: 1280x720.
    • timeout : duration to wait for AJAX loading to complete. Default to 5000 milliseconds.
    • extension : image file types. It could be jpg or png.

Examples:

proshot.multishot([
    'https://petehouston.com',
    'https://apple.com',
    'https://youtube.com'
]);

proshot.multishot([
    'https://petehouston.com',
    'https://apple.com',
    'https://youtube.com'
], '/home/petehouston/screenshots');

proshot.multishot([
    'https://petehouston.com',
    'https://apple.com',
    'https://youtube.com'
], '/home/petehouston/screenshots', {
    viewport: { width: 1920, height: 1080 },
    timeout: 3000,
    extension: 'jpg'
});
1.3.6

6 years ago

1.3.5

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago