Giter Club home page Giter Club logo

puppeteer-render-text-cli's Introduction

puppeteer-render-text-cli

CLI for rendering text with headless chrome.

NPM Build Status JavaScript Style Guide

Logo

This CLI is also available as a library.

Why?

ImageMagick is the traditional unix tool to programatically render text, and while it works very well for simple use cases, trying to use it to render rich text or html is very difficult. Pango is another option that's been around for ages, but both suffer from archaic syntax and minimal rich text support.

Puppeteer, on the other hand, allows for robust, headless chrome screenshots with best-in-class support for all modern html / text / font features.

This CLI makes it easy to use headless chrome to render text + html to images.

Features

  • built-in fontfaceobserver
  • easily load google fonts
  • optional word-wrap
  • main content is just html
  • styling is done via css
  • handles multiple fonts
  • thoroughly tested
  • includes a CLI

Install

npm install -g puppeteer-render-text-cli

Usage

  Usage: puppeteer-render-text [options] <text>

  Options:

    -V, --version                    output the version number
    -o, --output <path>              path of image file to store result (default: out.png)
    -w, --width <number>             optional max width
    -h, --height <number>            optional max height
    -g, --load-google-font           load font families from google
    -l, --load-font-family <string>  font family to load with fontfaceobserver
    -s, --style <string>             JSON string of CSS styles (default: { })
    --font-family <string>           font-family to add to style
    --font-size <string>             font-size to add to style
    --padding <string>               padding to add to style
    --color <string>                 color to add to style
    -h, --help                       output usage information

Related

License

MIT © Travis Fischer

Support my OSS work by following me on twitter twitter

puppeteer-render-text-cli's People

Contributors

transitive-bullshit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.