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

color-cc

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

color-cc

Get colors in your node.js console, support commonjs / typescript / esnext, simplified version of colors

  • 0.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-89.66%
Maintainers
0
Weekly downloads
 
Created
Source

color-cc

Get colors in your node.js console, Similar to colors, but a simplified version of it

Just work in Node.js

Support js / ts / es

install

npm i -S color-cc
# yarn add color-cc

usage

1.commonjs

const ColorCC = require('color-cc').default;
// const { ColorCC } = require('color-cc');

console.log(ColorCC.green('hello'));
console.log(ColorCC.red.underline('i like cake and pies'));

console.log(ColorCC.success('I have finished my work!'));
console.log(ColorCC.fail('It is not be done!'));
console.warn(ColorCC.warn('warning something...'));
console.error(ColorCC.error('It occurs errors!'));

don't forget the .default !!!

2.typescript/esnext

import ColorCC from 'color-cc';
// com
console.log('');
console.log(ColorCC.error('error text...'));
console.log(ColorCC.warn('warning text...'));
console.log(ColorCC.warning('warning text...'));
console.log(ColorCC.success('success text...'));
console.log(ColorCC.fail('fail text...'));

// F,  F.B,  F.S,  F.B.S
console.log('');
console.log(ColorCC.red('red'));
console.log(ColorCC.red.bgYellow('red.bgYellow'));
console.log(ColorCC.red.strike('red.strike'));
console.log(ColorCC.red.bgYellow.strike('red.bgYellow.strike'));

// B,  B.S
console.log('');
console.log(ColorCC.bgYellow('bgYellow'));
console.log(ColorCC.bgYellow.strike('bgYellow.strike'));

// S
console.log('');
console.log(ColorCC.bold('bold'));
console.log(ColorCC.underline('underline'));
console.log(ColorCC.blink('blink'));
console.log(ColorCC.strike('strike'));

API

Similar to colors, but a simplified version of colors

function like: (...args:[]) => string

fore,back,style
  • ColorCC.${foreName}
    • eg: ColorCC.red('abcdefg')
  • ColorCC.${foreName}.${backName}
    • eg: ColorCC.red.bgYellow('abcdefg')
  • ColorCC.${foreName}.${backName}.${styleName}
    • eg: ColorCC.red.bgYellow.bold('abcdefg')
  • ColorCC.${foreName}.${styleName}
    • eg: ColorCC.red.bold('abcdefg')
  • ColorCC.${backName}
    • eg: ColorCC.bgYellow('abcdefg')
  • ColorCC.${backName}.${styleName}
    • eg: ColorCC.bgYellow.bold('abcdefg')
  • ColorCC.${styleName}
    • eg: ColorCC.bold('abcdefg')
ansi prop name
// foreNames
type ForeCodePropName = "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray" | "grey" | "brightBlack" | "brightRed" | "brightGreen" | "brightYellow" | "brightBlue" | "brightMagenta" | "brightCyan" | "brightWhite";
// backNames
type BackCodePropName = "bgBlack" | "bgRed" | "bgGreen" | "bgYellow" | "bgBlue" | "bgMagenta" | "bgCyan" | "bgWhite" | "bgGray" | "bgGrey" | "bgBrightBlack" | "bgBrightRed" | "bgBrightGreen" | "bgBrightYellow" | "bgBrightBlue" | "bgBrightMagenta" | "bgBrightCyan" | "bgBrightWhite";
// styleNames
type StyleCodePropName = "bold" | "underline" | "blink" | "strike";
Common combinations
  • ColorCC.warn
  • ColorCC.error
  • ColorCC.success
  • ColorCC.fail
custom
  • ColorCC.colorify(text: string, options?: Partial)

Keywords

FAQs

Package last updated on 25 Jun 2024

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