Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

chalk npm

const chalk = require('chalk'); const error = chalk.bold.red;const warning = chalk.keyword('orange'); console.log(error('Error!'));console.log(warning('Warning!'));
Comment

npm installl chalk

const chalk = require('chalk');const log = console.log; // Combine styled and normal stringslog(chalk.blue('Hello') + ' World' + chalk.red('!')); // Compose multiple styles using the chainable APIlog(chalk.blue.bgRed.bold('Hello world!')); // Pass in multiple argumentslog(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); // Nest styleslog(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); // Nest styles of the same type even (color, underline, background)log(chalk.green(    'I am a green line ' +    chalk.blue.underline.bold('with a blue substring') +    ' that becomes green again!')); // ES2015 template literallog(`CPU: ${chalk.red('90%')}RAM: ${chalk.green('40%')}DISK: ${chalk.yellow('70%')}`); // ES2015 tagged template literallog(chalk`CPU: {red ${cpu.totalPercent}%}RAM: {green ${ram.used / ram.total * 100}%}DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}`); // Use RGB colors in terminal emulators that support it.log(chalk.keyword('orange')('Yay for orange colored text!'));log(chalk.rgb(123, 45, 67).underline('Underlined reddish color'));log(chalk.hex('#DEADED').bold('Bold gray!'));
Comment

PREVIOUS NEXT
Code Example
Shell :: install magento 2 docker 
Shell :: powershell set environment variable and run command 
Shell :: how to exit git bash 
Shell :: install chocolately path 
Shell :: magento ssh commands 
Shell :: install peer dependencies in npm 
Shell :: scp all files in currrent directory 
Shell :: git bring back deleted branch from local 
Shell :: laravel github 
Shell :: letsencrypt domain fetch /.well-known error 
Shell :: make kernel module 
Shell :: create rails app 
Shell :: git clone without project folder 
Shell :: Install GitLab using Docker Engine 
Shell :: flask make how public 
Shell :: bash script create file 
Shell :: check intellij version 
Shell :: git basics 
Shell :: remove a non empty directory 
Shell :: react native youtube install 
Shell :: github to gitlab 
Shell :: bash shuffle lines 
Shell :: O arquivo C:UsersjukinAppDataRoaming pmyarn.ps1 
Shell :: install kali software manager support 
Shell :: xp_cmdshell bcp 
Shell :: bash trim binary output 
Shell :: Create a bash script that asks users to change permission 
Shell :: linux up command multiple level of directory 
Shell :: how to remove mingw64 from git bash 
Shell :: linux bitcoin app 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =