1.0.1 • Published 10 years ago

iterm2-image v1.0.1

Weekly downloads
26
License
-
Repository
github
Last release
10 years ago

node-iterm2-image

Node.js bindings to display images in iTerm2 (nightly builds only).

iterm2-image

Install

npm install iterm2-image

Usage

var drawInIterm = require('iterm2-image');

Load (and display) an image from a filepath:

drawInIterm('./path-to-file.png', function () {
imgLoader('./path-to-file.png', function (err) {
  if (err) { throw err; }
  console.log('done!');
});

Easy, huh? Now using streams:

var http = require('http');

var img = 'http://your/image';

http.get(img, function(res) {
  if (res.statusCode === 200) {
    drawInIterm(res, function () {
      if (err) { throw err; }
      console.log('done!');
    });
  }
});

TODO

  • Parametrize output stream.
  • Return something meaningful in callback.

Credits

Inspired by iTerm2 Site image documentation section and Python Bindings.

Nyan Cat image obtained from here.

1.0.1

10 years ago

1.0.0

10 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago