/websites-screenshot-cli

take screenshot of a given website url

Primary LanguageJavaScriptMIT LicenseMIT

Websites screenshot CLI

CLI script to take screenshots for a specific URL. useful to take images for your personal projects

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and usage purposes.

Prerequisites

STEPS- You need to have Node installed and the Google Chrome browser.

Installing

Clone or download this repository.

git clone git@github.com:HenryTabima/websites-screenshot-cli.git

Open the project folder and install dependencies

cd websites-screenshot-cli
npm install

Usage

node urlscreenshot.js --url [url's site]

or

chmod +x urlscreenshot.js   // this is only once
./urlscreenshot.js --url [url's site]

PD: is better if you copy and paste the url from the website

Example

usage gif Result: screenshot result

The Config File

module.exports = {
  dir: './screenshots',
  screen: {
    width: 1920,
    height: 1080
  }
}

dir is to define where you want to save your screenshots.

screen is to define the width and height of the screenshot.

Built With

  • Puppeteer - Node library which provides a high-level API to control Chrome or Chromium
  • Minimist - simple cli argument parser

Author

Henry Tabima Giraldo
Henry Tabima Giraldo

📖

License

This project is licensed under the MIT License - see the LICENSE.md file for details