terminal-image
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.
Install
$ npm install terminal-image
Usage
const terminalImage = ; async { console;};
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 = ;const got = ; async { const body = await ; console;};
Related
- terminal-image-cli - CLI for this module
- terminal-link - Create clickable links in the terminal
- chalk - Style and color text in the terminal
License
MIT © Sindre Sorhus