imgcat
Display image in iTerm2 version 2.9+
Last updated 5 years ago by kchan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install imgcat 
SYNC missed versions from official npm registry.

imgcat NPM version NPM downloads

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.

Install

$ npm install --save imgcat

Usage

const 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})

API

imgcat(input, [options, events])

input

Type: string

Image path or URL.

options

term-img2 options. See https://github.com/sindresorhus/term-img#api.

events

Type: object

before

Type: function

Everything started.

after

Type: function

Everything done.

beforeDownload

Type: function

The download is started.

afterDownload

Type: function

The download is done.

Related

License

MIT © EGOIST

Current Tags

  • 2.3.0                                ...           latest (5 years ago)

10 Versions

  • 2.3.0                                ...           5 years ago
  • 2.2.0                                ...           5 years ago
  • 2.1.0                                ...           5 years ago
  • 2.0.0                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 11
Dependencies (5)
Dev Dependencies (1)

Copyright 2014 - 2016 © taobao.org |