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

colorprint

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colorprint

Print ansi-colored message to stdout/stderr.

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
402
decreased by-50.06%
Maintainers
1
Weekly downloads
 
Created
Source

colorprint

Build Status Code Climate Code Coverage npm Version

Print ansi-colored message to stdout/stderr.

Installation

npm install colorprint --save

Usage

var colorpint = require('colorpint');

colorpint.notice('This is NOTICE'); //Pipe to stdout with magenta color.
colorpint.info('This is INFO'); //Pipe to stdout with green color.
colorpint.debug('This is DEBUG'); //Pipe to stdout with  color.
colorpint.trace('This is TRACE'); //Pipe to stdout with white color.
colorpint.error('This is ERROR'); //Pipe to stderr with red color.
colorpint.fatal('This is FATAL'); //Pipe to stderr with bgRed color.

Using via CIL

Install globally

$ npm install colorprint -g

From Command Line

#!/bin/bash

colorpint notice "This is NOTICE from CLI" # Pipe to stdout with magenta color.
colorpint info "This is INFO from CLI" # Pipe to stdout with green color.
colorpint debug "This is DEBUG from CLI" # Pipe to stdout with  color.
colorpint trace "This is TRACE from CLI" # Pipe to stdout with white color.
colorpint error "This is ERROR from CLI" # Pipe to stderr with red color.
colorpint fatal "This is FATAL from CLI" # Pipe to stderr with bgRed color.


Fore more detail, see API Guide of colorpint functions.

Customizing

Customize the whole module.

var colorprint = require('colorprint');
colorprint.PREFIX='Yeah!';
colorprint.INFO_COLOR='blue';
colorprint.info('This will be blue with prefix.');

Create new context to customize.

var Colorprint = require('colorprint/lib/colorprint');
var colorprint = new Colorprint({
    PREFIX: '[Foo]',
    INFO_COLOR: 'blue'
});
colorprint.info('This will be blue with prefix.');


colorpint is using cli-color for coloring and you can see available colors here.

License

This software is released under the MIT License.

Keywords

FAQs

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