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

cli-color-tty

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-color-tty

cli-color that takes into account process.stdout.isTTY

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

cli-color-tty Build Status Dependency Status Coverage Status

The cli-color module but TTY aware. It provides a cli-color compatible API that doesn't colorize your strings for non-TTY use.

Example

var clc = require('cli-color-tty')(true)
// clc is = require('cli-color')

console.log(clc.red('RED')) // -> '\x1b[31mRED\x1b[39m'

clc = require('cli-color-tty')(false)
// clc is a cli-color compatible API that doesn't colorize

console.log(clc.red('RED')) // -> 'RED'

Usage

var clc = require('cli-color-tty')(/* true/false/default: process.stdout.isTTY */)

After calling the factory function, use it as per the cli-color docs.

Pass true to the factory function to get back the cli-color module.
Pass false to get back a cli-color compatible object that doesn't colorize your strings.
Defaults to process.stdout.isTTY

Keywords

FAQs

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