Over a million developers have joined DZone.
- {{node.title}}
{{node.type}} · {{ node.urlSource.name }} · by {{node.authors[0].realName }}
{{totalResults}} search results
{{announcement.body}}
Node.js Command Line Tutorial
DZone ‘s Guide to
Node.js Command Line Tutorial
We take a quick a look at a few commands you need to know to get started using Node.js to make applications.
Apr. 04, 19 · Web Dev Zone ·
Free Resource
Like (0)
Comment (0)
Save
{{ articles[0].views | formatCount}} Views
Join the DZone community and get the full member experience.
Let’s do some command line fun with Node.js :
Install colors:
npm install -g colors
Install cfonts:
npm install -g cfonts
Link colors and cfonts
npm link colors
andnpm link cfonts
Save the following code as love.js
Run love.js:
node love.js
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) }
Like This Article? Read More From DZone
Topics:
web dev ,node.js tutorial for beginners ,node.js application
Like (0)
Comment (0)
Save
{{ articles[0].views | formatCount}} Views
Opinions expressed by DZone contributors are their own.
Web Dev Partner Resources
- {{ node.blurb }}
{{ editionName }}
{{ parent.title || parent.header.title}}
{{ parent.tldr }}
{{ parent.linkDescription }}
· {{ parent.articleDate | date:'MMM. dd, yyyy' }} {{ parent.linkDate | date:'MMM. dd, yyyy' }}
{{ message }}
{{ $dialog.title }}