This module is a high level wrapper of SindreSorhus's term-img, to display images from both URL and file path. Actually this requires iTerm 2.9+ too.
$ npm install --save imgcatconst imgcat = require('imgcat')
// print image from file
imgcat('a.gif')
.then(image => {
console.log(image)
})
.catch(e => {
console.log(e.name)
})
// print image from url
// console.log directly
imgcat('http://path/to/image', {log: true})Type: string
Image path or URL.
term-img2 options. See https://github.com/sindresorhus/term-img#api.
Type: object
Type: function
Everything started.
Type: function
Everything done.
Type: function
The download is started.
Type: function
The download is done.
- imgcat-cli - CLI of this module.
MIT © EGOIST