0.0.1 • Published 4 months ago

clnk-terminal v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

QR Code Terminal Generator

Generate QR codes directly in your terminal or save them to files using this TypeScript CLI tool.

Installation

# Install globally
npm install -g qrcode-terminal-ts

# Or use with npx
npx qrcode-terminal-ts generate "https://example.com"

CLI Usage

# Basic usage
qrcode-term generate "https://example.com"

# With custom styling
qrcode-term generate "https://example.com" --dark "##" --light ".." --margin 2

# With colors
qrcode-term generate "https://example.com" --color "blue"
qrcode-term generate "https://example.com" --color "#ff0000"

# Compact mode
qrcode-term generate "https://example.com" --small

# Save to file
qrcode-term generate "https://example.com" --output qrcode.png

API Usage

You can also use this package programmatically:

import { renderQRCodeInTerminal, saveQRCodeToFile } from 'qrcode-terminal-ts';

// Display QR code in terminal
await renderQRCodeInTerminal('https://example.com', {
  dark: '██',
  light: '  ',
  margin: 2,
  small: false,
  color: 'blue' // or '#ff0000' for hex color
});

// Save QR code to file
await saveQRCodeToFile('https://example.com', 'qrcode.png');

Options

OptionDescriptionDefault
darkCharacter used for dark modules
lightCharacter used for light modulesspace
marginMargin size around QR code1
smallCompact mode without spaces between modulesfalse
colorColor for the QR code (named color or hex)-
outputFile path to save the QR code (PNG format)-

Available Colors

You can use any of these color names with the --color option:

  • black, red, green, yellow, blue, magenta, cyan, white
  • gray, grey, blackBright, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright

Or you can specify a hex color like #ff0000 for red.

License

MIT

0.0.1

4 months ago