Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/theodrosyimer/webcapt

A simple cli to screen capture web pages and save them to disk as images or pdfs.
https://github.com/theodrosyimer/webcapt

cli image-generation pdf-generation playwright webpage

Last synced: 8 days ago
JSON representation

A simple cli to screen capture web pages and save them to disk as images or pdfs.

Awesome Lists containing this project

README

        

# webcapt - CLI for web capture

Table of Contents

- [Motivation](#motivation)
- [Quick start](#quick-start)
- [Install](#install)
- [Usage](#usage)
- [Examples](#examples)
- [Contribute](#contribute)
- [Clone the repo](#clone-the-repo)
- [Install dependencies](#install-dependencies)
- [Develop](#develop)
- [Build the project](#build-the-project)
- [Run the project](#run-the-project)
- [Run tests](#run-tests)
- [Submit a pull request](#submit-a-pull-request)
- [License](#license)

## Motivation

A simple cli to screen capture web pages and save them to disk as images or pdfs.

## Quick start

### Install

```sh
npm install -g webcapt
```

```sh
pnpm install -g webcapt
```

## Usage

```sh
webcapt -h
```

```sh
Usage: webcapt [options] [command]

A simple cli to screen capture web pages and save them to disk as images or pdfs.

Options:
-V, --version output the version number
-h, --help display help for command

Commands:
pdf [options] Screenshot the provided url and download as a pdf
img [options] Screenshot the provided url and download as an image
help [command] display help for command
```

```sh
wbecapt pdf -h
```

```sh
Usage: webcapt pdf [options]

Screenshot the provided url and download as a pdf

Options:
-u, --url URL to download
-o, --output Output file name
-f, --format Format of the file to download, options: A4 or letter, default: A4 (default: "A4")
-h, --help display help for command
```

```sh
webcapt img -h
```

```sh
Usage: webcapt img [options]

Screenshot the provided url and download as an image

Options:
-u, --url URL to download
-o, --output Output file name
-f, --format Format of the file to download, options: png or jpeg, default: png (default: "png")
-h, --help display help for command
```

### Examples

> Note: For pdfs and images, you don't need to specify the file's extension if you want to download to a format other than the default, you can use the `-f` flag and specify the file's format.

```sh
webcapt pdf -u https://google.com -o example
```

If you want to download an image in jpeg format:

```sh
webcapt img -u https://google.com -o example -f jpeg
```

If you want to download a pdf in letter format:

```sh
webcapt pdf -u https://google.com -o example -f letter
```

## Contribute

### Clone the repo

```sh
git clone https://github.com/theodrosyimer/webcapt@latest
cd webcapt
```

### Install dependencies

```sh
pnpm install
```

### Develop

```sh
pnpm run dev
```

### Build the project

```sh
pnpm run build
```

### Run the project

```sh
pnpm start
```

### Run tests

```sh
npm test
```

### Submit a pull request

If you'd like to contribute code, documentation, or any other improvements, please [fork the project](https://gihub.com/theodrosyimer/webcapt/fork), make your changes, and submit a pull request.

If you're unsure about adding a feature or fixing a bug, create an issue to discuss it first.

## License

MIT © [Theodros Yimer](https://github.com/theodrosyimer)