DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Coding
  3. JavaScript
  4. Node.js Command Line Fun

Node.js Command Line Fun

We take a quick a look at a few commands you need to know to get started using Node.js to make applications.

Shishir Kumar user avatar by
Shishir Kumar
·
Apr. 05, 19 · Code Snippet
Like (3)
Save
Tweet
Share
9.81K Views

Join the DZone community and get the full member experience.

Join For Free

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)
}
Node.js Command (computing)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Deploying Java Serverless Functions as AWS Lambda
  • Top 12 Technical Skills Every Software Tester Must Have
  • GPT-3 Playground: The AI That Can Write for You
  • Secrets Management

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: