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

console-hue

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
c

console-hue

Description

1.0.3
latest
68

Supply Chain Security

100

Vulnerability

86

Quality

76

Maintenance

100

License

Unpopular package

Quality

This package is not very popular.

Found 1 instance in 1 package

Version published
Weekly downloads
78
-46.58%
Maintainers
1
Weekly downloads
 
Created
Issues
0

console-hue

This tiny module is basically an improved version of the native console.log, adding colour support for different type of messages and a "Stringify" functionality by default for Objects and Arrays.

Install

You can install with [npm]:

$ npm install --save console-hue

Usage

When you import the module, the following methods will be exposed:


const consoleh = require('console-hue')
{ error: [Function],
  success: [Function],
  warn: [Function],
  debug: [Function],
  log: [Function],
  blue: [Function],
  pink: [Function],
  red: [Function],
  green: [Function],
  yellow: [Function],
  cyan: [Function] }

And then you can use consoleh with any of the previous methods to get a colourful reply in the console:


> const consoleh = require('console-hue')
// Green output
consoleh.success('This message should be green')
// Red output
consoleh.error('This message should be red')
// Yellow output
consoleh.warning('This message should be yellow')

As described before the module will attempt to "Stringify" the Arrays and Objects passed in the message sent to the module. You can override this behaviour by passing true as the second parameter:


> const consoleh = require('console-hue')
// With default Stringigy behaviour
consoleh.log({fn: function(msg) {console.log(msg)}})
{}
// Getting the original msg without Stringigy
consoleh.log({fn: function(msg) {console.log(msg)}}, true)
[object Object]

License

Copyright © 2019, Juan Convers. Released under the MIT License.

FAQs

Package last updated on 26 Dec 2019

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