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.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.6K
increased by13.47%
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.
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);
pass a color name as the first argument
console.color("green", "text with green color");
console.ecolor("red", "text with red color", "to stderr");

FAQs

Package last updated on 17 Oct 2011

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