New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

codepic

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codepic

Turn code into PNG or SVG images from the command line.

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
187
49.6%
Maintainers
1
Weekly downloads
 
Created
Source

CodePic CLI

Turn code into PNG or SVG images from the command line. Highlighting and layout run locally; nothing is uploaded.

Install

npm install -g codepic

Or run without installing:

npx codepic --help

Requires Node 22 or newer.

Usage

codepic --file app.ts --theme nord -o out.png
cat app.ts | codepic --lang typescript -o out.svg

Code comes from --file or standard input. -o / --output sets the path (default codepic.png). A .svg extension writes SVG. Language is guessed when you omit --lang; with --file, the filename is used as the title unless you pass --title.

codepic --help

Appearance options

These match the CodePic web app URL parameters and the same option names on the command line.

OptionValues
--langLanguage id, e.g. typescript, python, shell
--themegithub-light, github-dark, dracula, nord, one-dark-pro
--bgBackground preset (ocean, slate, sunset, forest, paper, charcoal, violet, rose) or transparent
--padding16, 32, 64, 128
--width320–1600
--font12, 14, 15, 16, 18, 20, 24
--lhLine height, 1.2–2
--windowcontrols, minimal, borderless
--linesLine numbers: true or false
--wrapWrap long lines: true or false
--showTitleShow filename: true or false
--titleWindow title (up to 200 characters)
--scalePNG scale: 1, 2, 3
--formatpng or svg
--highlightLines to emphasize, e.g. 2,5-7
--addedLines marked as added
--removedLines marked as removed

Invalid values print a clear error and exit with status 1.

Notes

Images use the same highlighter, themes, and layout as the browser app. The drop shadow is approximated, and wrapping is by character count, so wide characters (CJK, emoji) may extend past a row.

License

MIT

Keywords

cli

FAQs

Package last updated on 01 Oct 2026

Related posts