# imgcat

> Display image in iTerm2 version 2.9+

Latest version **2.3.0** (published 2016-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install imgcat
pnpm add imgcat
yarn add imgcat
bun add imgcat
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2016-04-14 |
| First published | 2016-02-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 40 |
| Author | EGOIST |
| Maintainers | kchan |
| Keywords | imgcat, image |

## Links

- npm: https://www.npmjs.com/package/imgcat
- Repository: https://github.com/egoist/imgcat
- Homepage: https://github.com/egoist/imgcat#readme
- Issues: https://github.com/egoist/imgcat/issues
- npm.io page: https://npm.io/package/imgcat

## Dependencies (5)

- [co](https://npm.io/package/co.md) ^4.6.0
- [pget](https://npm.io/package/pget.md) ^0.1.1
- [is-url](https://npm.io/package/is-url.md) ^1.2.1
- [tempfile](https://npm.io/package/tempfile.md) ^1.1.1
- [term-img2](https://npm.io/package/term-img2.md) ^2.0.0

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 2.3.0 (latest) — 2016-04-14
- 2.2.0 — 2016-03-16
- 2.1.0 — 2016-03-16
- 2.0.0 — 2016-03-16
- 1.1.1 — 2016-03-11
- 1.1.0 — 2016-03-08
- 1.0.1 — 2016-03-06
- 1.0.0 — 2016-03-06
- 0.1.1 — 2016-02-19
- 0.1.0 — 2016-02-19

## README

# imgcat [![NPM version](https://img.shields.io/npm/v/imgcat.svg)](https://npmjs.com/package/imgcat) [![NPM downloads](https://img.shields.io/npm/dm/imgcat.svg)](https://npmjs.com/package/imgcat)

This module is a high level wrapper of SindreSorhus's [term-img](https://github.com/sindresorhus/term-img), to display images from both URL and file path. Actually this requires iTerm 2.9+ too.

## Install

```bash
$ npm install --save imgcat
```

## Usage

```js
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](https://github.com/EGOIST-robot/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

- [imgcat-cli](https://github.com/egoist/imgcat-cli) - CLI of this module.

## License

MIT © [EGOIST](https://github.com/egoist)

---
_Source: https://npm.io/package/imgcat · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
