npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tinky-image

v1.0.0

Published

Terminal image rendering for the Tinky CLI framework

Downloads

48

Readme

tinky-image

Terminal image rendering for Tinky.

Entry points

tinky-image exports the Node runtime by default:

import { Image } from "tinky-image";

<Image src="./logo.png" width={40} alt="logo" />;

Use the browser entry when your app is bundled with sharp-web:

import { Image } from "tinky-image/browser";

Demos

Run the CLI demo:

npm run demo:cli

For a non-interactive smoke check that renders once and exits:

npm run demo:cli -- --snapshot

Run the browser demo with tinky-web:

npm run demo:web

Build the browser demo bundle:

npm run demo:web:build

The browser demo renders the shared Tinky showcase app inside an Xterm.js surface provided by tinky-web, so the CLI and web examples stay aligned. Click the terminal and use the left/right arrow keys or 1-4 to switch renderers.

Source types

Node supports:

  • File paths such as ./logo.png
  • Absolute URLs such as https://example.com/logo.png
  • Data URLs
  • Uint8Array
  • Blob

Browser supports:

  • Relative URLs such as ./logo.png and /logo.png
  • Absolute URLs such as https://example.com/logo.png
  • blob: URLs
  • Data URLs
  • Uint8Array
  • Blob

Sizing

width and height are measured in terminal cells. Each accepts a number of cells (width={40}) or a percentage of the terminal (width="50%"). The resizeMode prop controls how the image is fit into that box and defaults to "contain":

  • "contain" (default) — scale to fit entirely inside the box, preserving aspect ratio. If only one of width/height is given, the other is derived from the source aspect ratio; if both are given, the image fits inside the box.
  • "cover" — scale to fill the box, preserving aspect ratio. The image may overflow the box on one axis (the overflow is cropped by the terminal).
  • "fill" — stretch to the exact width×height, ignoring aspect ratio.
  • "none" — use the image's natural cell size, ignoring width/height.
<Image src="./logo.png" width={40} resizeMode="contain" />

Every mode except "none" clamps the rendered size to the current terminal bounds.

Backends

Backends are auto-detected in this order:

  1. kitty
  2. iterm
  3. sixel
  4. halfblock
  5. braille
  6. ascii

You can override detection with the renderer prop.

Backend overview

  • kitty — terminal graphics protocol output for Kitty-compatible terminals
  • iterm — inline image protocol output for iTerm2-compatible terminals
  • sixel — bitmap graphics output for terminals that support Sixel
  • halfblock — full-color text rendering using ANSI colors and the Unicode half-block character
  • braille — monochrome high-density rendering using Unicode Braille patterns
  • ascii — plain character-art fallback for maximum compatibility