1.0.1 • Published 10 years ago

ansi-webkit v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

ANSI-WebKit

turns this

ansi

into this

webkit

how

var aw = require('ansi-webkit');
var str = '[42mspawn ';
console.log.apply(console, aw.parse(str));

example

// show the dev tools by default
require('nw.gui').Window.get().showDevTools().resizeTo(800, 1000);
var aw = require('ansi-webkit');

var spawn = require('child_process').spawn,
  child = spawn('node', ['spawn.js']);

child.stdout.on('data', function (e) {
  var str = e.toString().trim();
  // ansi
  console.log(str);
  // parsed
  console.log.apply(console, aw.parse(str));
});

child.stderr.on('data', function (e) {
  var str = e.toString().trim();
  console.log(str);
});

license

MIT