Big news!Introducing Socket AI - ChatGPT-Powered Threat Analysis.Learn more
Socket
Socket

coloured

Package Overview
Dependencies
0
Maintainers
0
Versions
2
Issues
File Explorer

Advanced tools

coloured

Pretty colours in your terminal.

    0.2.0latest
    GitHub
    npm

Version published
Maintainers
0
Weekly downloads
489
decreased by-70.07%

Weekly downloads

Readme

Source

Coloured

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() )

Screenshot

For more examples see example/example.js.

Colours & Extras

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).

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white

Extras are used the same as colours.

  • clear
  • bold
  • underline
  • reverse

Installation

With npm: npm install coloured

With git: git clone git://github.com/gf3/coloured.git

API

When require'd this module returns a Colour object with the following methods and properties.

Methods

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.

Properties

Colour.colours → Object Object containing colour names and values.

Colour.extras → Object Object containing extra names and values.

Author

Written by Gianni "gf3" Chiappettagf3.ca

License

Coloured is UNLICENSED.

FAQs

Last updated on Invalid Date

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.

Install Socket
Socket
Socket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc