How to use 'Kleur' Module in Node.js ? Last Updated : 23 Jul, 2024 Comments Improve Suggest changes Like Article Like Report 'kleur' module is an external NPM module that can manage color properties in JavaScript applications or projects. It allows developers or programmers to manipulate and use colors in their projects. By using kleur, we change the colors of the outputs in the console which make it looks good.Installation: To use this module in our project, we've to install it first. Open the terminal, navigate to the same folder as your project, and use the commands to install this module. After this, a new JSON file, 'package.json' will be added to your project, which contains all the details of the module installed.$ npm install kleur Folder structure: Use the module: After installation, we have to import 'kleur' module using the require function and then used this to manipulate the colors of different texts in the output.const kleur = require('kleur');Run: After successfully importing and writing the code, we can run the code written in the file. Use the given command to run the javascript code. In this command index.js is the JavaScript file name.$ node index.jsHere are some examples of how can we use "kleur" module:Example 1: JavaScript // Require the 'kleur' module const kleur = require('kleur'); // Create variables with colored strings const red = kleur.red().bold('GeeksforGeeks'); const blueBg = kleur.bgBlue('How to use Kleur module in node.js?'); const boldYellow = kleur.yellow().bold('This is bold yellow color'); const greenUnderline = kleur.green().underline('This is green underline color'); // Log the colored strings to the console console.log(red); console.log(blueBg); console.log(boldYellow); console.log(greenUnderline); Output:Example 2: JavaScript const { bold, green } = require('kleur'); console.log(bold().red('this is a bold red message')); console.log(bold().italic( 'this is a bold italicized message')); console.log(bold().yellow().bgRed().italic( 'this is a bold yellow italicized message')); console.log(green().bold().underline( 'this is a bold green underlined message')); Output: Comment More infoAdvertise with us Next Article How to use 'Kleur' Module in Node.js ? G gulshankumar136 Follow Improve Article Tags : Web Technologies Node.js NodeJS-Questions Node-npm Similar Reads How to use EcmaScript Modules in Node.js ? Using ECMAScript Modules (ES Modules or ESM) in Node.js allows you to take advantage of modern JavaScript syntax for organizing and managing your code. ECMAScript Modules provide a more structured and standardized way to work with modules compared to CommonJS, which has been traditionally used in No 2 min read How to use Superheroes Module in Node.js ? The superheroes module is a fun and simple Node.js package that allows you to generate random superhero names. It's a great example of how to use third-party modules in Node.js and can be useful for testing, generating sample data, or just adding some flair to your applications. In this article, we' 2 min read How to work Mongojs module in Node.js ? Mongojs module is a built-in module in node.js that facilitates the usage of MongoDB with Node.js. It offers almost all the functionality that is provided by the official API of MongoDB and is used extensively by developers across the globe. Â Follow the steps mentioned below to install mongojs modu 3 min read How to write code using module.exports in Node.js ? module is a discrete program, contained in a single file in Node.js. They are tied to files with one module per file. module.exports is an object that the current module returns when it is "required" in another program or module. We are going to see a simple code like the calculator to learn how to 3 min read How to use Node.js REPL ? Node.Js REPL or Read-Evaluate-Print Loop is an interactive shell for the Node.js environment which means we can write any valid Javascript code in it. This is used to test, evaluate, experiment, or debug code much easier and accessible way. It basically acts as the Browser's Web dev tools' Console f 6 min read Like