typo-image

Typo-image is an ANSI image plugin for typo - draw images into command-line (CLI)!

Typo-image

The typo plugin to draw an image in command-line (CLI)!

npm install typo --save
npm install typo-image --save

** Typo-image only supports 8-bit png(png-8) file so far. **

Maybe someday typo-image will support any image format using ImageMagick. But I really doesn't have much spare time.

An available demo is located at 'demo/typo-image.js':

node demo/typo-image.js
var typo = require('typo')({
    output: process.stdout
});
typo.plugin( require('typo-image') );
 
// pay attension, this.is an async method  
typo.log('{{~image ./icon.png}}');

Be free to print an image for many times, typo-image will cache the result. You could also save your output by using typo.template().

And there are also bunch of options to help you manage your image:

typo.log('{{~image:options ./icon.png}}', {
    options: {
        indent: 4
    }
});

'~' is one of the typo conventions used to idenfity an asynchronous helper.

typo.log(
    '{{~image[:<options>] <image_path>}}', 
    [<substitution>], 
    [<callback>]
);

(what's coming...)

Number

no support so far

Number

no support so far

Number

supported

Number

supported

Boolean

supported

Path

supported