page-save-as
v1.0.6
Published
Page save as PNG/PDF using chromium headless
Downloads
11
Readme
Page Save As
Page save as JPG/PNG/PDF
It uses Puppeteer( puppeteer-chromium-resolver) API to save a page.
Install
npm i page-save-as
Node.js API
const PSA = require("page-save-as");
const option = await PSA({
url: "xxx",
name: "xxx",
type: "jpg/png/pdf"
});
see test.js
API Default Options
see option.js
CLI
#global install:
npm i page-save-as -g
#execute command
psa <url> --name filename --type jpg
#uses "npx psa ..." for local install
CLI Options
- -n, --name
<name>
save filename - -t, --type
<type>
file type: jpg(default)/png/pdf - -w, --width
<width>
page width - -s, --scroll scroll to bottom
- -e, --edit edit mode")
- -o, --output
<path>
output path - -ds, --delay
<s>
delay in seconds - -ts, --timeout
<s>
timeout in seconds
CHANGELOG
1.0.5
- support local file
- updated PCR
1.0.4
- support edit for pdf format
1.0.3
- fixed filename
1.0.2
- fixed output
- added delay
- updated scroll logic
- updated edit complete logic
- updated puppeteer-chromium-resolver to latest
1.0.1
- fixed filename