Display images in the terminal
Works in any terminal that supports colors.
In iTerm, the image will be displayed in full resolution, since iTerm has special image support.
$ npm install terminal-image
const terminalImage = require('terminal-image');
(async () => {
console.log(await terminalImage.file('unicorn.jpg'));
})();
// Image from url
(async () => {
console.log(await terminalImage.url('https://www.host.com/img.jpg'));
})();
Supports PNG and JPEG images.
Returns a Promise<string>
with the ansi escape codes to display the image.
Type: Buffer
Buffer with the image.
Returns a Promise<string>
with the ansi escape codes to display the image.
Type: string
File path to the image.
- terminal-image-cli - CLI for this module
- terminal-link - Create clickable links in the terminal
- chalk - Style and color text in the terminal
MIT © Sindre Sorhus, Faisal KANOUT