show images in console with node.js

علی ذوالفقار
1400/10/14 08:28:30 (439)
to show images in console with node.js use one of these packages :
1 - image-to-ascii
2 - console-png
var ImageToAscii = require('image-to-ascii');
ImageToAscii(__dirname + '/logo.png', function(err, converted) {
    console.log(err || converted);
});

// Attach module to the console
require('console-png').attachTo(console);

// Read the image, let console-png output it to console
console.png(require('fs').readFileSync(__dirname + '/logo.png'));
Back