Node.js Command Line Fun

Node.js Command Line Fun

Let's have some command line fun with Node.js : 1. Install colors: `npm install -g colors`  2. Install cfonts: `npm install -g cfonts`  3. Link colors and cfonts  `npm link colors` and `npm link cfonts`  4. Save the following code as...

Let's have some command line fun with Node.js :

  1. Install colors: npm install -g colors 

  2. Install cfonts: npm install -g cfonts 

  3. Link colors and cfonts  npm link colors and npm link cfonts 

  4. Save the following code as love.js

  5. Run love.js:  node love.js 

  6. Output

var colors = require('colors');

const CFonts = require('cfonts');

interval = 4000
for(i=1;i<20;i++){
    setTimeout(d1,i*interval);
    setTimeout(d2,i*interval+(interval/5));
    setTimeout(d3,i*interval+(2*interval/5));
    setTimeout(d4,i*interval+(3*interval/5));
    setTimeout(d5,i*interval+(4*interval/5));
}

function d1(){
 console.log('\x1Bc');
 d0('green')
}

function d2(){
console.log('\x1Bc');
    d0('blue')
 }

function d3(){
console.log('\x1Bc');
    d0('red')
 }

function d4(){
console.log('\x1Bc');
    d0('yellow')
 }

function d5(){
console.log('\x1Bc');
    d0('magenta')
 }

function d0(col1){

CFonts.say('    LOVE     ', {
    font: 'block',              // define the font face
    align: 'left',              // define text alignment
  //  colors: ['red'],         // define all colors
    colors: [col1],         // define all colors
    background: 'transparent',  // define the background color, you can also use `backgroundColor` here as key
    letterSpacing: 1,           // define letter spacing
    lineHeight: 1,              // define the line height
    space: true,                // define if the output text should have empty lines on top and on the bottom
    maxLength: '0',             // define how many character can be on one line
});

console.log('   ***     ***                   ***     ***                   ***     ***'.rainbow)
console.log(' **   ** **   **               **   ** **   **               **   ** **   **'.rainbow)
console.log('*       *       *             *       *       *             *       *       *'.rainbow)
console.log('*               *             *               *             *               *'.rainbow)
console.log(' *     LOVE    *               *     LOVE    *               *     LOVE    *'.rainbow)
console.log('  **         **   ***     ***   **         **   ***     ***   **         **'.rainbow)
console.log('    **     **   **   ** **   **   **     **   **   ** **   **   **     **'.rainbow)
console.log('      ** **    *       *       *    ** **    *       *       *    ** **'.rainbow)
console.log('        *      *               *      *      *               *      *'.rainbow)
console.log('                *     LOVE    *               *     LOVE    *'.rainbow)
console.log('   ***     ***   **         **   ***     ***   **         **   ***     ***'.rainbow)
console.log(' **   ** **   **   **     **   **   ** **   **   **     **   **   ** **   **'.rainbow)
console.log('*       *       *    ** **    *       *       *    ** **    *       *       *'.rainbow)
console.log('*               *      *      *               *      *      *               *'.rainbow)
console.log(' *     LOVE    *               *     LOVE    *               *     LOVE    *'.rainbow)
console.log('  **         **   ***     ***   **         **   ***     ***   **         **'.rainbow)
console.log('    **     **   **   ** **   **   **     **   **   ** **   **   **     **'.rainbow)
console.log('      ** **    *       *       *    ** **    *       *       *    ** **'.rainbow)
console.log('        *      *               *      *      *               *      *'.rainbow)
console.log('                *     LOVE    *               *     LOVE    *'.rainbow)
console.log('                 **         **                 **         **'.rainbow)
console.log('                   **     **                     **     **'.rainbow)
console.log('                     ** **                         ** **'.rainbow)
console.log('                       *                             *'.rainbow)
}

Fun coding! Thank you

Node.js Webdeveloper

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Hire Node.js Developers And How Much Does It Cost?

A Guide to Hire Node.js Developers who can help you create fast and efficient web applications. Also, know how much does it cost to hire Node.js Developers.

Hire Node.JS Developers | Skenix Infotech

We are providing robust Node.JS Development Services with expert Node.js Developers. Get affordable Node.JS Web Development services from Skenix Infotech.

Hands on with Node.Js Streams | Examples & Approach

The practical implications of having Streams in Node.js are vast. Nodejs Streams are a great way to handle data chunks and uncomplicate development.

Node.js Performance: Node.js vs. Io.js

You may already be aware that Raygun uses Node.JS for our API nodes that receive your precious crash reporting data (we also do node.js crash reporting if you’re interested). We’ve peaked in the past at more than 110,000 requests per second coming...

Node.js Live | Node.js Docker Tutorial | Dockerizing Node.js App|Node.js Training|Edureka

🔥 Node.js Certification Training: https://www.edureka.co/nodejs-certification-training This Edureka video on 'Node.js Docker Tutorial' will help you in learn...