Being a developer, it’s our daily job to interact with the command-line; it is a crucial part of our lives, but sometimes we get bored because of its dull appearance.

What if i told you there is a facile way that can enhance our logs output look. Well, you heard it right; there is a package called Chalk, which can make our work accessible, and command-line logs will no longer look peculiar to us.

Adding Chalk to the node project is easy, and it can enormously enhance the look and feel of our logs. You can easily style the colorize the output; simultaneously, it also boosts the user experience.

The chalk library offers powerful and simple methods to enforce ANSI colors and styles to our terminal output. This package is trendy and gets more than 5 million downloaded a week, which is a lot.

Create Node Project

Before we begin, we need to set up a brand new Node application. We need to execute the couple of mentioned below commands through the command prompt or terminal window to create a new project.

However, you can skip this step if you are done with this step.

mkdir your-project-name

Head over to the project root:

cd your-project-name

Run the following command to scaffolding the package.json file. Evidently, It will smoothly install all the dependencies in the node_modules folder.

npm init

#node js #node

Style Command Line Output with Chalk Package in Node.js
1.50 GEEK