Socket
Socket
Sign inDemoInstall

ansi-webkit

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansi-webkit

Print ANSI escaped colors in a browser console


Version published
Maintainers
1
Created
Source

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

Keywords

FAQs

Package last updated on 18 Sep 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc