Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ansi-color-stream

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansi-color-stream

colorize a stream with ansi colors

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ansi-color-stream

colorize a stream with ansi colors

example

Here we create 3 streams and interleave the colored chunks.

var through = require('through2');
var colorize = require('ansi-color-stream');

var a = through();
var b = through();
var c = through();

a.pipe(colorize('bg bright pink fg purple')).pipe(process.stdout);
b.pipe(colorize('purple')).pipe(process.stdout);
c.pipe(colorize('bg cyan fg blue')).pipe(process.stdout);

a.write('AAA');
b.write('BBB');
c.write('CCC\n');

b.write('bb');
c.write('ccc');
a.write('a\n');

methods

var colorize = require('ansi-color-stream')

var stream = colorize(color)

Return a transform stream that adds color to each of the chunks. color is a fuzzy string name or array that describes the color to use.

install

With npm do:

npm install ansi-color-stream

license

MIT

Keywords

FAQs

Package last updated on 13 Jul 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