All Projects โ†’ Runjuu โ†’ Page2image

Runjuu / Page2image

Licence: mit
๐Ÿ“ท page2image is a npm package for taking screenshots which also provides CLI command

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Page2image

Puppeteer Dart
A Dart library to automate the Chrome browser over the DevTools Protocol. This is a port of the Puppeteer API
Stars: โœญ 92 (+39.39%)
Mutual labels:  screenshot, puppeteer, headless-chrome
Apify Js
Apify SDK โ€” The scalable web scraping and crawling library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.
Stars: โœญ 3,154 (+4678.79%)
Mutual labels:  npm, puppeteer, headless-chrome
Site Scan
CLI for capturing website screenshots, powered by puppeteer.
Stars: โœญ 137 (+107.58%)
Mutual labels:  cli, screenshot, puppeteer
Singlefile
Web Extension for Firefox/Chrome/MS Edge and CLI tool to save a faithful copy of an entire web page in a single HTML file
Stars: โœญ 4,417 (+6592.42%)
Mutual labels:  cli, screenshot, puppeteer
puppet-master
Puppeteer as a service hosted on Saasify.
Stars: โœญ 25 (-62.12%)
Mutual labels:  screenshot, headless-chrome, puppeteer
Md To Pdf
Hackable CLI tool for converting Markdown files to PDF using Node.js and headless Chrome.
Stars: โœญ 374 (+466.67%)
Mutual labels:  cli, puppeteer, headless-chrome
Puppeteer Sharp Extra
Plugin framework for PuppeteerSharp
Stars: โœญ 39 (-40.91%)
Mutual labels:  puppeteer, headless-chrome
Gowitness
๐Ÿ” gowitness - a golang, web screenshot utility using Chrome Headless
Stars: โœญ 996 (+1409.09%)
Mutual labels:  screenshot, headless-chrome
Puphpeteer
A Puppeteer bridge for PHP, supporting the entire API.
Stars: โœญ 1,014 (+1436.36%)
Mutual labels:  puppeteer, headless-chrome
Nls
Missing inspector for npm packages.
Stars: โœญ 44 (-33.33%)
Mutual labels:  cli, npm
Singlefilez
Web Extension for Firefox/Chrome/MS Edge and CLI tool to save a faithful copy of an entire web page in a self-extracting HTML/ZIP polyglot file
Stars: โœญ 882 (+1236.36%)
Mutual labels:  cli, puppeteer
Chart To Aws
Microservice to generate screenshot from a webpage and upload it to a AWS S3 Bucket.
Stars: โœญ 43 (-34.85%)
Mutual labels:  screenshot, puppeteer
Be Course 17 18
๐ŸŽ“ Backend ยท 2017-2018 ยท Curriculum and Syllabus ๐Ÿ’พ
Stars: โœญ 44 (-33.33%)
Mutual labels:  cli, npm
Npm Build Boilerplate
A collection of packages that build a website using npm scripts.
Stars: โœญ 963 (+1359.09%)
Mutual labels:  cli, npm
Gub
CLI tool for create an npm package from any repos. ๐Ÿณ
Stars: โœญ 31 (-53.03%)
Mutual labels:  cli, npm
Jsdom Screenshot
๐Ÿ“ธ Take screenshots of jsdom with puppeteer
Stars: โœญ 39 (-40.91%)
Mutual labels:  screenshot, puppeteer
Typac
install npm packages along with corresponding typings
Stars: โœญ 29 (-56.06%)
Mutual labels:  cli, npm
Catage
Node package and CLI tool to convert code into an image with syntax highlighting
Stars: โœญ 44 (-33.33%)
Mutual labels:  cli, npm
Cli
The command line vault (Windows, macOS, & Linux).
Stars: โœญ 1,044 (+1481.82%)
Mutual labels:  cli, npm
Dark Mode Screenshot
This Puppeteer script takes a ๐Ÿ“ท screenshot of a webpage in ๐ŸŒž Light and ๐ŸŒ’ Dark Mode.
Stars: โœญ 47 (-28.79%)
Mutual labels:  screenshot, puppeteer

๐Ÿ“ท page2image

npm version Total downloads Build Status PRs Welcome Greenkeeper badge MIT Licence

page2image is an npm package using Headless Chrome for taking screenshots which also provides CLI command

Using By Module ๐Ÿ“ฆ

Install

npm i page2image --save

Quick Examples

import Screenshot from 'page2image';

const screenshot = new Screenshot({
  waitUntil: 'networkidle2',
  viewportConfig: { width: 1920, height: 1080 },
  screenshotConfig: { fullPage: true, path: 'screenshot.png' },
});

screenshot
  .takeScreenshot('https://github.com/Runjuu')
  .then(process.exit);

Methods

takeScreenshot(url:string)

Accept a url string as an argument and return an image Buffer

init(Config)

Accept a Config object and next time calling takeScreenshot will using new config to take screenshot

Config: {}


Using By CLI โŒจ๏ธ

Install

npm i page2image --global

Quick Examples

# Single page
> page2image https://github.com/Runjuu --type=jpeg --quality=80

# Multi-page
> page2image https://github.com/Runjuu https://github.com/Runjuu --type=jpeg --quality=80

# Local file
> page2image ./index.html --type=jpeg --quality=80

Args <argv>: <default value>

width: 1366

Page width in pixels.

height: 768

Page height in pixels, default will take a full page screenshot.

type: png

Specify screenshot type, could be either 'jpeg' or 'png'.

quality: 100

The quality of the image, between 0-100. Not applicable to png images.

dpr: 2

Specify device scale factor.

selector: null

take a screenshot for the selected element

page2image https://github.com/Runjuu --selector=".js-contribution-graph"

disableJS: false

To disable JavaScript on the page.

waitUntil: networkidle2

When to consider navigation succeeded. more details

sleep: 0

if sleep is a number

Wait ${sleep} milliseconds to take screenshot.

if sleep is a selector

Wait for the selector to appear in page

emulate: false

List of all available devices is available in the source code. Below is an example of using emulate args to emulate iPhone 6

page2image https://github.com/Runjuu --emulate=iPhone6 

scrollToBottom: false

Wait till viewport scroll to the bottom of the page

named: <default using url to named>

Name of screenshot

path: <default using current path>

Path to save the screenshot

page2image https://github.com/Runjuu --path=../
page2image https://github.com/Runjuu --path=/User/someone/
page2image https://github.com/Runjuu --path=~/Downloads



To Do

  • [x] take screenshots via url
  • [x] take screenshots from local html file
  • [ ] take multiple screenshots from file

๐Ÿค” have any questions? ๐Ÿ‘‰ new issues ๐Ÿ˜‰

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].