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

ansi-colorizer

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ansi-colorizer

Colorize/brighten text for terminals with ANSI escape sequences

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
62
decreased by-69.61%
Maintainers
4
Weekly downloads
 
Created
Source

ansi-colorizer

Build status

Dim and bright pretty shell colors

ansi-colorizer is a small utility to add ANSI escape sequences to strings to output them with color. Configuring the colorizer produces an object that may or may not colorize or brighten text.

configure(options)

Returns a new colorizer instance. Configuration options are color and bright. Both are booleans, and both are false by default. If both settings are false (the default), the colorizer will not really do anything. When color is true, methods colorize strings. When bright is true, all color methods will result in the bright color variant.

var ansiColorizer = require("ansi-colorizer");

var colorizer = ansiColorizer.configure({ color: true, bright: false });
colorizer.red("Hey"); //=> "\x1b[31mHey\x1b[0m"

colorizer = ansiColorizer.configure({ color: true, bright: trie });
colorizer.red("Hey"); //=> "\x1b[1m\x1b[31mHey\x1b[0m"

colorizer = ansiColorizer.configure();
colorizer.red("Hey"); //=> "Hey"

bold(string)

Brightens the string.

red(string)

Colors string red.

yellow(string)

Colors string yellow.

green(string)

Colors string green.

purple(string)

Colors string purple.

cyan(string)

Colors string cyan.

grey(string)

Colors string grey.

FAQs

Package last updated on 12 Nov 2015

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