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

@nopecha/pprint

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nopecha/pprint

A pretty-print utility for Node.js

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

@nopecha/pprint

npm version

This package provides pretty-print logging functions for Node.js.

Installation

npm install @nopecha/pprint

Usage

Add to the top of the entry file of the project.

import '@nopecha/pprint'

The above will expose the pretty-print logging functions to the global scope.

Replace console with global to color-code terminal outputs in Node.js.

Available are trace, debug, info, log, warn, and error.

global.trace()  // Red
global.debug('this is green')
global.info('this is cyan')
global.warn('this is yellow')
global.error('this is red')
global.log('this does not have a color yet')

Add color to log messages. Color codes are prefixed with ! in their own string.

global.log('!r', 'this is red')
global.log('!g', 'this is green')
global.log('!b', 'this is blue')

Add background colors with a second color code.

global.log('!rb', 'this is red on blue')

Add text styles with a third color code.

global.log('!uwd', 'underlined')    // underlined, white on dark
global.log('!bdw', 'bolded')        // bolded, dark on white
global.log('!igw', 'italicized')    // italicized, green on white

Multiple colors can be used in a single log statement.

Note that all color code strings including "!" are zero width, except "! " where a color-stop code can contain a space that is left untrimmed.

global.log('!r', 'this is red', '!', ' this is normal ', '!b', 'blue', '! ', 'normal')

© 2024 NopeCHA, LLC

Keywords

nopecha

FAQs

Package last updated on 13 May 2024

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