console-style

WebJar for console-style

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

console-style
Last Version

Last Version

0.1.2
Release Date

Release Date

Type

Type

jar
Description

Description

console-style
WebJar for console-style
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mrdaniellewis/node-console-style

Download console-style

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/console-style/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>console-style</artifactId>
    <version>0.1.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/console-style/
implementation 'org.webjars.npm:console-style:0.1.2'
// https://jarcasting.com/artifacts/org.webjars.npm/console-style/
implementation ("org.webjars.npm:console-style:0.1.2")
'org.webjars.npm:console-style:jar:0.1.2'
<dependency org="org.webjars.npm" name="console-style" rev="0.1.2">
  <artifact name="console-style" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='console-style', version='0.1.2')
)
libraryDependencies += "org.webjars.npm" % "console-style" % "0.1.2"
[org.webjars.npm/console-style "0.1.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Add colour to the console

npm version

Add colours and style to the node.js console output.

Alternatives

https://www.npmjs.org/package/colors, but it modifies String.prototype and is therefore wrong.

Intallation

$ npm install console-style

Usage

var style = require('console-style');

// Output bold, underlined and red text
console.log( style.bold.underline.red('Hello world') );

The arguments applied to the style are passed to util.format. This means objects will be inspected, and placeholders can be used.

// Alternative syntax
console.log( style( 'Hello world',  [ 'bold', 'underline', 'red' ] ) );

This syntax does not use util.format.

Options

See http://en.wikipedia.org/wiki/ANSI_colors#Colors

  • bold
  • italic - not widely supported
  • underline
  • inverse
  • strikethough - not widely supported
  • white
  • black
  • blue
  • cyan
  • green
  • magenta
  • red
  • yellow
  • whiteBG
  • blackBG
  • blueBG
  • cyanBG
  • greenBG
  • magentaBG
  • redBG
  • yellowBG

Versions

Version
0.1.2