add example file
This commit is contained in:
parent
4ce73b632b
commit
492f11fb59
2 changed files with 20 additions and 0 deletions
17
example.js
Normal file
17
example.js
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
'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) + ' ');
|
||||||
|
}
|
||||||
|
|
@ -62,6 +62,9 @@
|
||||||
"envs": [
|
"envs": [
|
||||||
"node",
|
"node",
|
||||||
"mocha"
|
"mocha"
|
||||||
|
],
|
||||||
|
"ignores": [
|
||||||
|
"example.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue