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

rich-console

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

rich-console

A node.js module let console can output colorful text. like html, you can set text color throw tag, for example: '<green>hellow <cyan>world<cyan>!</green>. so far the fllowing color was supported: black, red, green, yellow or orange, blue, pink,

  • 0.0.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

rich-console

Purpose

A node.js module let console can output colorful text. like html, you can set text color throw tag, for example:
'hellow world!. so far the fllowing color was supported: black, red, green, yellow or
orange, blue, pink, cyan, white.

Features

  • get rich output template that can be used by console.log
  • output log content
  • output error content with red color

Example

  var richConsle = require('rich-console');
  
  // if you need to output many times, recommend to use getRichTmpl
  var tmp1 = richConsle.getRichTmpl('%s <red>%s</red> <green>%s</green> <cyan>%s</cyan>');
  var tmp2 = richConsle.getRichTmpl('%s <red>%s</red> <green>%s</green> <cyan>%s</cyan>', true);
  richConsle.log(tmp1, 'dark version:', 'red', 'green', 'cyan');    // dark linght 
  richConsle.log(tmp2, 'bright verison:', 'red', 'green', 'cyan');  // bright light
  
  // if you output not frequently, can use log or error method
  richConsle.log('<red>a color <pink><cyan>nest</cyan> example, can <red>nested</red> any</pink> times!</red>');
  richConsle.error('a error occured, info: [<cyan>%s</cyan>], please fix and run agin', 'foo error info'); 

FAQs

Package last updated on 20 Aug 2014

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