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

@seanmcp/time-console

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@seanmcp/time-console

Add a time stamp and color to all your console messages.

latest
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

time-console

Add a time stamp and color to all your console messages.

Color-coded console messages with time stamps

Why?

I like coloring and time-stamping my console messages in a particular way while preserving the default console methods. If you are okay with monkey patching, checkout the more popular console-stamp or log-timestamp.

Documentation

Install

npm i --save @seanmcp/time-console

Use

const { log } = require('@seanmcp/time-console')()

log('Hello world!')
// -> [22:39:06:947] Hello world!

Four console methods are exposed:

  • error: red
  • info: cyan
  • log: gray
  • warn: yellow

Customize

For a different date format, pass you preferred a date format string to the higher-order function:

const { error } = require('@seanmcp/time-console')('YY/MM/DD HH:mm:ss')

error('Error!')
// -> [19/05/31 23:34:08] Error!

FAQs

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