Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/frinyvonnick/node-html-to-image-cli

A cli based on node-html-to-image that generates images from HTML
https://github.com/frinyvonnick/node-html-to-image-cli

Last synced: about 1 month ago
JSON representation

A cli based on node-html-to-image that generates images from HTML

Awesome Lists containing this project

README

        

Welcome to node-html-to-image-cli 👋



Version


Documentation


License: Apache--2.0


Twitter: yvonnickfrin

> A cli based on node-html-to-image that generates images from HTML

### 🏠 [Homepage](https://github.com/frinyvonnick/node-html-to-image-cli)

## Description

This is cli is based on [node-html-to-image](https://github.com/frinyvonnick/node-html-to-image). It generates an image from an HTML file. `node-html-to-image` provides more options and lets you pass down custom configuration to puppeteer which is used under the hood.

![node-html-to-image-cli's demo](https://raw.githubusercontent.com/frinyvonnick/node-html-to-image-cli/master/misc/demo.gif)

## Prerequisites

- node >=10

## Install

This step is uneccessary if you use npx.

```sh
yarn add global node-html-to-image-cli
# or
npm install -g node-html-to-image-cli
```

## Usage

Without handlebars template

```sh
npx node-html-to-image-cli examples/simple.html ./image.png
```

With additional data passed to the template

```sh
npx node-html-to-image-cli examples/handlebars.html ./image.png --content ./examples/handlebars.json
```

### Arguments

| Argument | Description |
|----------|------------------------------------|
| html | path to a html file |
| output | path where image should be created |

### Options

| Option | Alias | Description |
|-----------|-------|-------------------------------------------------|
| --type | -t | type of image that should be generated |
| --transparent | none | determine if background of the generated image should be transparent |
| --content | -c | path to a content file with handlebars template |

## Related

- [node-html-to-image](https://github.com/frinyvonnick/node-html-to-image) - API for this cli

## Author

👤 **FRIN Yvonnick **

* Website: [https://yvonnickfrin.dev](https://yvonnickfrin.dev)
* Twitter: [@yvonnickfrin](https://twitter.com/yvonnickfrin)
* Github: [@frinyvonnick](https://github.com/frinyvonnick)

## 🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/frinyvonnick/node-html-to-image-cli/issues).

## Show your support

Give a ⭐️ if this project helped you!

## 📝 License

Copyright © 2019 [FRIN Yvonnick ](https://github.com/frinyvonnick).

This project is [Apache--2.0](https://github.com/frinyvonnick/node-html-to-image-cli/blob/master/LICENSE) licensed.

***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_