ansi-webkit

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i ansi-webkit

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • simov