New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tinting

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinting

A styled Console

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Desciption

This is a node.js module to beatuify the console in terminal.

Usage

Simple

const tint = require('tinting')

// log
tint.log('log')

// info
tint.info('info')

// table
tint.table({ a: 1, b: 2 })
tint.table([1, 2, 3])

// error
tint.error('error')

// and other methods of console,
// only use the original
// for example:
tint.time('label') // only call the console.time, doing nothing
tint.timeEnd('label')

the result is:
result.jpg

Custom

you can initialize a new instance with custom style by calling tint.createInstance(options)

const tint = require('tinting')
const con = tint.createInstance({
    logStyle: {
        text: ['yellow', 'bold']
    }
})
con.log('log')
// now, output a yellow and bold string when calling log

options

{
    logStyle: {
        text: ['green'],
        keyword: [{
            'k': ['yellow', 'bold']
        }]
    },
    // the style of info, error, global is the same as logStyle
    // If the style of the invoked method does not exist, 
    // the style of global will be applied
    tableStyle: {
        layer: 1, // the output layer
        head: ['white', 'bold'], // the head style
        border: ['bold', 'magenta'] // the border style
    }
}
// the text property is to change the style of the whole string
// the keyword property is to change the style of the keyword in string, It takes precedence over `text`

FAQs

Package last updated on 22 Jun 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