npm.io
1.1.127 • Published 4d agoCLI

@rip-lang/print

Licence
MIT
Version
1.1.127
Deps
1
Size
30 kB
Vulns
0
Weekly
0
Stars
28


Rip Print - @rip-lang/print

Syntax-highlighted source code printer

Highlights source code using highlight.js and serves the result in the browser for viewing and printing. Serves once and exits — no leftover files, no cleanup.

Quick Start

# Install
bun add -g @rip-lang/print

# Print all source files in a directory
rip-print src/

# Print specific files
rip-print src/compiler.js src/lexer.js

# Dark theme
rip-print -d src/

# Strip leading comment blocks
rip-print -b src/

# Exclude extensions
rip-print -x lock,map src/

Features

  • highlight.js — 190+ languages, beautiful GitHub-style themes
  • Auto-detect languages — 40+ languages supported
  • Light and dark themes — GitHub Light (default) and GitHub Dark
  • Print-optimized CSS — page breaks between files, clean headers
  • Table of contents — auto-generated for multi-file output
  • Sticky headers — file names stay visible while scrolling
  • Serve once — opens browser, serves the page, exits automatically
  • No leftover files — everything is in-memory

Options

Flag Description
-b, --bypass Strip leading comment blocks from files
-d, --dark Use dark theme (default: light)
-h, --help Show help
-x <exts> Comma list of extensions to exclude

How It Works

  1. Walks the specified paths, discovers source files
  2. Highlights each file using highlight.js with the detected language
  3. Builds a single HTML page with table of contents
  4. Starts a Bun server on a random port
  5. Opens the browser
  6. Exits after serving the page

Print from the browser with Cmd+P (Mac) or Ctrl+P (Windows/Linux).