coloured
Advanced tools
Weekly downloads
Readme
Pretty colours in your terminal. This is a node.js port of defunkt's colored.
Colour.extendString()
console.log( "this is red".red() )
console.log( "this is red with a blue background (read: ugly)".red_on_blue() )
console.log( "this is red with an underline".red().underline() )
console.log( "this is really bold and really blue".bold().blue() )
For more examples see example/example.js
.
As a convenience all colours and extras are available as methods on strings.
Colours may be specified alone (e.g. red
), or they may be specified with
a background like so foreground_on_background
(e.g. black_on_cyan
).
Extras are used the same as colours.
With npm: npm install coloured
With git: git clone git://github.com/gf3/coloured.git
When require
'd this module returns a Colour object with the following methods
and properties.
Colour.extendString( nativeProto ) → Undefined
native
- Prototype to extend. Default: String.prototype
.Colour.colourise( string, options ) → String
string
- String to be coloured. Required.options
- Object with any of the following properties: foreground
, background
, extra
. Default: {}
.Colour.colour( name, background ) → String
name
- Colour name (e.g. "red"
). Required.background
- Set to true if background colour is desired. Default: false
.Colour.extra( name) → String
name
- Extra name (e.g. "bold"
). Required.Colour.colours → Object
Object containing colour names and values.
Colour.extras → Object
Object containing extra names and values.
Written by Gianni "gf3" Chiappetta – gf3.ca
Coloured is UNLICENSED.
FAQs
Pretty colours in your terminal.
The npm package coloured receives a total of 484 weekly downloads. As such, coloured popularity was classified as not popular.
We found that coloured demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.