consimilo-screengrab
Usage
- Install from npm with
npm install consimilo-screengrab
- Create a ScreenshotQueue
; const ssQueue = baseFolder: "~/Documents" threads: 1 ;
- Add ScreenshotConfigs
ssQueue;
- Add event listeners
ssQueue;ssQueue;ssQueue;
- Start the process
ssQueuestart;
Configuration
ScreenshotQueue
ScreenshotQueue is a constructor that can take the following options
baseFolder
: Required, sets the folder that images will be stored inthreads
: Default:1
, sets the number of threads that run simultaneously
ScreenshotConfig
The .add
method can take a single or multiple ScreenshotConfigs. Available options:
url
: Required, sets the URL that is scannedwidth
: Optional, sets the width of the window when screenshot is grabbedelement
: Optional, instead of taking a screenshot of the entire page, take a screenshot of a single elementhideElements
: Optional, array of strings that can be passed to document.querySelectorAll()variations
: Optional, variations are a way to take multiple screenshots of the same url without reloading the page. It can take all of the above options, except url