Skip to content

simov/ansi-webkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ANSI-WebKit

turns this

ansi

into this

webkit

how

var aw = require('ansi-webkit');
var str = '[42m�[31m�[1mspawn�[22m�[39m�[49m ';
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

About

Print ANSI escaped colors in a browser console

Resources

License

Stars

Watchers

Forks

Packages

No packages published