An open API service indexing awesome lists of open source software.

https://github.com/edgaraafelix/screenshotter

Take screenshots to any page from your command line
https://github.com/edgaraafelix/screenshotter

commanderjs node-js nodejs npm npm-package puppeteer screenshot screenshotter

Last synced: 3 months ago
JSON representation

Take screenshots to any page from your command line

Awesome Lists containing this project

README

          

Screenshotter
-------

Experimenting with [puppeteer](https://github.com/GoogleChrome/puppeteer/) and [commander.js](https://github.com/tj/commander.js/) to build a tool to take screenshots to any page from your command line.

#### Installation

```npm install -g screenshotter-cli```

#### Usage

Basic Example:

```screenshotter --url https://github.com```

With custom path:

```screenshotter --url https://github.com --path ~/Public```

With specific element;

```screenshotter --url https://github.com --element ".jumbotron-codelines"```

Emulate device:

```screenshotter --url https://github.com --device "iPhone 6"```

#### Options

| Name | Type | Default | Description |
|-------------|--------|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| --url | string | N/A | The page URL to navigate to. |
| --element | string | N/A | Which element to screenshot instead of the full page. |
| --full-page | bool | true | Whether to screenshot the full page. |
| --width | int | N/A | Custom screenshot width. Depends on ```--full-page``` to be ```false``` |
| --height | int | N/A | Custom screenshot height. Depends on ```--full-page``` to be ```false``` |
| --device | string | N/A | Which device to emulate. List of all available devices is available in the source code: [DeviceDescriptors.js](https://github.com/GoogleChrome/puppeteer/blob/master/DeviceDescriptors.js). |
| --path | string | process.cwd() | Where to save the file generated by the screenshot action. By default it will save within the directory you are executing ```screenshotter```. |

#### Dependencies

- [puppeteer](https://github.com/GoogleChrome/puppeteer/)
- [commander.js](https://github.com/tj/commander.js/)
- [lodash](https://github.com/lodash/lodash)

#### License

Licensed under the MIT license.