
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
puppeteer-screenshots
Advanced tools
This package provides a simple way to take screenshots and PDFs of urls.
This is a wrapper around Google's Puppeteer package.
This package is in Alpha. This package follows SemVer.
Install using
npm i puppeteer-screenshots
There is two ways to use puppeteer-screenshots
, the first is by doing this in your app file
require('puppeteer-screenshots').init();
that way you can call your program from the command line like this
node app.js --url=https://www.google.com
and a screenshot will be made and into "image.png". You can optionally specify path with --path=/path/to/file.png.
The other way to use it is to do this
var ps = require('puppeteer-screenshots');
ps.screenshot({url: 'https://google.com', path: 'google.png'});
which will save a screenshot of Google in 'google.png'. Note that here we don't have the double hyphens as when using from the command line.
The available options you can pass to 'puppeteer-screenshots' are as follows
--url - (required) the url to take screenshot of
--path - (optional) the path to save the screenshot to, default is 'image.png'
--viewportWidth - (optional) the viewport width, default value is 1280 pixels
--viewportHeight - (optional) the viewport height, default value is 768 pixels
--userAgent - (optional) the user agent to use
--mobile - (optional) if this is set to true it will use a mobile user agent and set the viewport width to 320px and the viewport height to 480px, note that this overrides viewportWidth, viewportHeight and userAgent
--pdf - (optional) if true saves the screenshot as pdf
--mediaTypePrint - (optional) if set emulates the media type as print
--hide - (optional) a comma separated list of css selectors of elements which to hide using JavaScript, e.g if there are any pop-ups you want to hide
--visibility (optional) a comma separated list of css selectors of elements which to hide using JavaScript this is different than `hide` in that it sets the visibility property to hidden rather than the display to none
FAQs
Wrapper around Puppeteer for easier website screenshots.
The npm package puppeteer-screenshots receives a total of 0 weekly downloads. As such, puppeteer-screenshots popularity was classified as not popular.
We found that puppeteer-screenshots demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.