carbon-now-cli

🎨 Beautiful images of your code — from right inside your terminal.

Build Status XO code style Featured in awesome-nodejs Twitter Follow Maintenance MIT license

Table of Contents

Description

carbon.now.sh by @dawn_labs is a wonderful tool that lets you generate beautiful images of your source code through an intuitive UI, while letting you customize aspects like fonts, themes, window controls and much more.

carbon-now-cli gives you the full power of Carbon — right at your fingertips, inside the terminal.

Generate beautiful images from a source file, or sections of a source file, by running a single command.

Want to customize everything before generating the image? Run it in ⚡️ interactive mode ⚡️. 😎

Basic example

Features

  • 🖼 Downloads the realhigh-quality image (no DOM screenshots)
  • ✨ Detects file type automatically
  • 🗂 Supports all file extensions supported by carbon.now.sh and more
  • ⚡️ Interactive mode via --interactive
  • 🎒 Presets: save and reuse your favorite settings
  • 🖱 Selective highlighting via --start and --end
  • 📎 Copies image to clipboard via --copy (cross-OS 😱)
  • 🐶 Displays image directly in supported terminals
  • ⏱ Reports each step and therefore shortens the wait
  • 👀 Saves to given location or only opens in browser for manual finish
  • 🌈 Supports saving as .png or .svg — just like Carbon
  • 📏 Supports 2x4x or 1x resolutions — just like Carbon
  • ✅ Tested
  • ⛏ Maintained

Installation

npm

$ npm i -g carbon-now-cli

yarn

$ yarn global add carbon-now-cli

npx

$ npx carbon-now-cli <file>

Requirements

Minimum Node.js version

Usage

$ carbon-now --help

Beautiful images of your code — from right inside your terminal.

Usage
  $ carbon-now <file>

Options
  -s, --start          Starting line of <file>
  -e, --end            Ending line of <file>
  -i, --interactive    Interactive mode
  -l, --location       Image save location, default: cwd
  -t, --target         Image name, default: original-hash.{png|svg}
  -o, --open           Open in browser instead of saving
  -c, --copy           Copy image to clipboard
  -p, --preset         Use a saved preset
  -h, --headless       Use only non-experimental Puppeteer features
  --config             Use a different, local config (read-only)

Subscribe to the Newsletter

Get our latest news,tutorials,guides,tips & deals delivered to your inbox.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.