Popularity
4.3
Growing
Activity
1.7
Declining
469
5
24

Monthly Downloads: 0
Programming language: JavaScript
Latest version: v0.2.0

terminal-image alternatives and similar modules

Based on the "Command-line utilities" category

Do you think we are missing an alternative of terminal-image or a related project?

Add another 'Command-line utilities' Module

README

terminal-image Build Status

Display images in the terminal

Works in any terminal that supports colors.

In iTerm, the image will be [displayed in full resolution](screenshot-iterm.jpg), since iTerm has special image support.

Install

$ npm install terminal-image

Usage

const terminalImage = require('terminal-image');

(async () => {
    console.log(await terminalImage.file('unicorn.jpg'));
})();

API

Supports PNG and JPEG images.

terminalImage.buffer(imageBuffer)

Returns a Promise<string> with the ansi escape codes to display the image.

imageBuffer

Type: Buffer

Buffer with the image.

terminalImage.file(filePath)

Returns a Promise<string> with the ansi escape codes to display the image.

filePath

Type: string

File path to the image.

Tip

Display a remote image

const terminalImage = require('terminal-image');
const got = require('got');

(async () => {
    const {body} = await got('sindresorhus.com/unicorn', {encoding: null});
    console.log(await terminalImage.buffer(body));
})();

License

MIT © Sindre Sorhus


*Note that all licence references and agreements mentioned in the terminal-image README section above are relevant to that project's source code only.