add rainbow example
This commit is contained in:
parent
09fb2d8606
commit
c0155688cf
2 changed files with 42 additions and 2 deletions
17
example.js
17
example.js
|
|
@ -1,17 +0,0 @@
|
|||
'use strict';
|
||||
const chalk = require('.');
|
||||
|
||||
// Generates screenshot
|
||||
for (const key of Object.keys(chalk.styles)) {
|
||||
let ret = key;
|
||||
|
||||
if (key === 'reset' || key === 'hidden' || key === 'grey') {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (/^bg[^B]/.test(key)) {
|
||||
ret = chalk.black(ret);
|
||||
}
|
||||
|
||||
process.stdout.write(chalk[key](ret) + ' ');
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue