New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

coloredlog

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

coloredlog

Simple package to log properly colored messages to proper output streams

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

coloredlog

This is a simple utility to log stuff to console without having to manually color it.

Why?

Aren't there many log libraries already?

Sure! But I wasn't satisfied by any of them, since they either had too much or too little stuff, so I always ended up copying and pasting the same files over all my projects, untill I finally decided I wanted to be able to yarn add coloredlog, and here we are xD

Usage

Just watch and repeat :P

import {log, info, error, warn} from 'coloredlog';

log('This will be output to console.log with a blue color');

info('This will be output to console.info with a cyan color');

error('This will be output to console.error with a red color');

warn('This will be output to console.warn with a yellow color');

NODE_ENV

If you set NODE_ENV environment variable to either test or silent, this module will shut it's mouth up. Useful for when you're running automated tests and don't want stuff getting in your way.

Contributing

Com'on, you already know how to do this! Just PR me, I'll be happy to reveal and merge :D

TODO

  • Integrate prettyjson to format objects, when wanted;
  • Support custom colors for each output stream

FAQs

Package last updated on 21 May 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc