New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

termcolor

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

termcolor

console.color

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.5K
decreased by-49.04%
Maintainers
1
Weekly downloads
 
Created
Source

termcolor

[Node.js] console.log, console.error with colors

Installation

git clone git://github.com/shinout/termcolor.git

OR

npm install termcolor

Usage

require
var tc = require("termcolor").define();
// remember to call define(), which defines methods under "console" object.

// var tc = require("termcolor").define;
// this is the same as define(), as termcolor internally use Object.defineProperty's getter/setter.
the simplest usage
console.green("this is green"); // displays "this is green" with green color to STDOUT
console.cyan({hoge: "foobar"}, "multi args? N.P.");
check which colors we can use
console.log(tc.colors);
/* 
    ['black',
    'red',
    'green',
    'yellow',
    'blue',
    'purple',
    'cyan',
    'white']
 */
display to STDERR
console.eblue("blue color, to stderr");
console.eyellow(["yellow color", "to stderr"], "of course, any value is acceptable");
get colored string
var redstr    = tc.red("red string");
var purplestr = tc.purple("purple string");
console.log(redstr, purplestr);
bold
console.bold("hoge")
console.bold("green", "BOLD GREEN")
console.purpleB("with B")
console.eyellowB("e [color] B")
pass a color name as the first argument
console.color("green", "text with green color");
console.ecolor("red", "text with red color", "to stderr");

Keywords

FAQs

Package last updated on 22 Feb 2012

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