Popularity
3.1
Declining
Activity
1.8
Declining
279
6
14

Monthly Downloads: 0
Programming language: JavaScript
License: MIT License
Tags: Ansi     Command Line Utilities     Image     Console     App     Term     Terminal     Version     Gif     Command-line     Escape     Shell     Jpeg     Jpg     Picture     Pic     Gifs     Photo     Img     Iterm2     Iterm    
Latest version: v5.0.0

term-img alternatives and similar modules

Based on the "Command Line Utilities" category.
Alternatively, view term-img alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of term-img or a related project?

Add another 'Command Line Utilities' Module

README

term-img Build Status

Display images in iTerm

You probably want the higher-level terminal-image package for displaying your images.

[](screenshot.jpg)

Even animated gifs!

Currently only supported on iTerm >=3.

Install

$ npm install term-img

Usage

const termImg = require('term-img');

function fallback() {
    // Return something else when not supported
}

console.log(termImg('unicorn.jpg', {fallback}));

API

termImg(image, options?)

Get the image as a string that you can log manually.

image

Type: string | Buffer

Filepath to an image or an image as a buffer.

options

Type: object

width
height

Type: 'auto' | string | number

The width and height are given as a number followed by a unit, or the word 'auto'.

  • N: N character cells.
  • Npx: N pixels.
  • N%: N percent of the session's width or height.
  • auto: The image's inherent size will be used to determine an appropriate dimension.
preserveAspectRatio

Type: boolean\ Default: true

fallback

Type: Function\ Default: () => throw new UnsupportedTerminalError()

Enables you to do something else when the terminal doesn't support images.

Related