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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

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

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • How To Use the Node Docker Official Image
  • Google Action With Node.js
  • Cypress Web Automation
  • Deploy a Hyperledger Fabric v2 Web App Using the Node.js SDK

Trending

  • Cloud Cost Optimization for ML Workloads With NVIDIA DCGM
  • How AI Is Changing the Way Developers Write Code
  • How Large Tech Companies Architect Resilient Systems for Millions of Users
  • Metrics at a Glance for Production Clusters
  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.

By 
Shishir Kumar user avatar
Shishir Kumar
·
Updated Apr. 05, 19 · Code Snippet
Likes (3)
Comment
Save
Tweet
Share
10.5K 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.

Related

  • How To Use the Node Docker Official Image
  • Google Action With Node.js
  • Cypress Web Automation
  • Deploy a Hyperledger Fabric v2 Web App Using the Node.js SDK

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!