1. console-group
basic console.group implementation for node
console-group
Package: console-group
Created by: rich-harris
Last modified: Mon, 13 Jun 2022 21:59:26 GMT
Version: 0.3.3
License: MIT
Downloads: 25,579
Repository: https://github.com/rich-harris/node-console-group

Install

npm install console-group
yarn add console-group

node-console-group

In browsers, console.group() is an incredibly useful debugging tool:

 function foo (input) {
  console.group('we are debugging', 'foo');
  console.log('input value:');
  console.log(input);
  console.group('nested group');
  console.log('console.groupception')
  console.groupEnd();
  console.groupEnd();

  return input.answer;
}

foo({answer: 42});

console-group-browser

But it doesn't exist in node.js! It was driving me crazy, so I created this package:

console-group-terminal

It's a 5 minute job - highly unsophisticated, doesn't even have a test suite, so YMMV. I'm not planning to actively maintain it (though I'll certainly take pull requests). Be warned! If that doesn't put you off, read on for usage instructions.

Installation and usage

Install...

 npm install console-group

...and use. This overwrites the console.log method, and adds console.group and console.groupEnd.

 require( 'console-group' ).install();

// later, if you want to clean up
require( 'console-group' ).teardown();

License

MIT.

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin