/node-escapes

writable stream to render ansi graphics into canvas

Primary LanguageJavaScript

escapes

writable stream to render ansi graphics into canvas.

This is escapes.js ported to node.js using node-canvas.

example

given node.ans by fcambus:

var fs = require('fs');
var escapes = require('escapes');

fs.createReadStream(__dirname + '/node.ans')
	.pipe(escapes(function (canvas) {
		var s = '<img src="' + canvas.toDataURL() + '">';
		fs.writeFile('out.html', s);
	}));

now open out.html because it's awesome:

screenshot

See also http://sixteencolors.net for many more awesome artpacks.

# api

var escapes = require('escapes');

var stream = escapes(cb);

# todo

  • streaming png/jpeg support

license

mit