🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

term-img2

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

term-img2

Display images in your terminal

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
1
Created
Source

term-img2

Display images in your terminal

Even animated gifs!

Currently only supported on iTerm >=2.9.

Install

$ npm install --save term-img2

Usage

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

termImg('unicorn.jpg', {log: true});

API

termImg(input, [options])

input

Type: string buffer

Filepath to an image or an image as a buffer.

options

width
height

Type: 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

log

Type: boolean

Log image in terminal, false by default.

fallback

Type: function
Default: () => throw new UnsupportedTerminal()

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

return

Type: string
The image string that can be displayed in terminal.

  • imgcat - CLI for this module

License

MIT © EGOIST

Keywords

term

FAQs

Package last updated on 14 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts