You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

caroline

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

caroline

colourful console output for node.js

0.0.2
latest
npmnpm
Version published
Weekly downloads
505
-31.66%
Maintainers
1
Weekly downloads
 
Created
Source

caroline

A small terminal color library and logger for Node.js based on ANSI escape codes.

Installation

npm install caroline

Example

var logger = require('caroline');
console.log(logger.bg.red(logger.color.cyan(logger.style.italic('Test'))));

logger.print('Text', {
  color : 'white',
  background : 'green',
  bold : true,
  italic : true
});

API Documentation

caroline.style

  • bold(text)
  • italic(text)
  • underline(text)

caroline.color

  • black(text)
  • red(text)
  • green(text)
  • yellow(text)
  • blue(text)
  • magenta(text)
  • cyan(text)
  • white(text)
  • gray(text)

caroline.background

  • black(text)
  • red(text)
  • green(text)
  • yellow(text)
  • blue(text)
  • magenta(text)
  • cyan(text)
  • white(text)

caroline.print(text, [options])

var logger = require('caroline');
logger.print('Italic text', {
  italic : true
});

logger.print('Underline text', {
  underline : true
});

logger.print('Bold text', {
  bold : true
});

Log messages

  • caroline.log('Log message', [arg1, args2 ...])
  • caroline.info('Info message', [arg1, args2 ...])
  • caroline.warn('Warn message', [arg1, args2 ...])
  • caroline.error('Error message', [arg1, args2 ...])

Convenience methods

  • caroline.enable()
  • caroline.disable() - Enable/disable logging
  • caroline.disableColors() - Disable the coloring of the output
  • caroline.enableColors()
  • caroline.hidePrefixes() - Don't show the LOG|INFO etc. prefix
  • caroline.showPrefixes()
  • caroline.hideTimestamps() - Don't display the timestamp
  • caroline.showTimestamps()

Run the tests

npm test

Keywords

console

FAQs

Package last updated on 18 Feb 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