Installations
npm install eight-colors
Releases
Unable to fetch releases
Developer
cenfun
Developer Guide
Module System
CommonJS, ESM, UMD
Min. Node Version
Typescript Support
Yes
Node Version
20.17.0
NPM Version
10.8.2
Statistics
1 Stars
32 Commits
1 Watching
1 Branches
1 Contributors
Updated on 23 Nov 2024
Languages
JavaScript (75%)
HTML (25%)
Total Downloads
Cumulative downloads
Total Downloads
8,585,461
Last day
4.4%
56,481
Compared to previous day
Last week
17.8%
306,124
Compared to previous week
Last month
16.2%
1,184,428
Compared to previous month
Last year
484%
7,240,949
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
3
Eight Colors
Eight colors for the console
Install
npm i eight-colors
Features
- Eight Colors:
black
,red
,green
,yellow
,blue
,magenta
,cyan
,white
- Background and Bright
- Styles: reset, bold, faint, italic, underline, inverse, hidden, strike
- Remove colors
- Log colors
- ESM/CJS
- TypeScript
- env
NO_COLOR
FORCE_COLOR
and flags--no-color
--color
- 0 dependencies
- 2.6K Size
Usage
1const EC = require("eight-colors");
2
3// text color
4console.log(EC.red('red string'));
5
6// background color
7console.log(EC.bg.red('red background'));
8
9// bright color
10console.log(EC.br.red('bright red string'));
11
12// bright background color
13console.log(EC.br.bg.red('bright red background'));
14
15// style
16console.log(EC.italic('italic text'));
17console.log(EC.underline('underline text'));
18console.log(EC.green(EC.underline('green underline text')));
19
20// remove color
21const redString = EC.red('red string');
22console.log(redString);
23const string = EC.remove(redString);
24console.assert(string === 'red string');
25
26// log color
27const res = EC.logRed('string1', 'string2');
28console.assert(EC.remove(res) === 'string1 string2');
29
30EC.logGreen('log green');
31EC.logRed('log red');
32EC.logCyan('log cyan');
33EC.logBlack('log black');
34EC.logWhite('log white');
35
36EC.log('log 2 arguments', '2');
37EC.logGreen('logGreen 2 arguments', '2');
38EC.logMagenta('logMagenta 3 arguments', '2', '3');
39
40// disabled color
41EC.disabled = true;
42EC.logRed('disabled = true log default');
43EC.disabled = false;
44EC.logRed('disabled = false log red');
45
APIs
1EC.black(str)
2EC.red(str)
3EC.green(str)
4EC.yellow(str)
5EC.blue(str)
6EC.magenta(str)
7EC.cyan(str)
8EC.white(str)
9
10EC.bg.black(str)
11EC.bg.red(str)
12EC.bg.green(str)
13EC.bg.yellow(str)
14EC.bg.blue(str)
15EC.bg.magenta(str)
16EC.bg.cyan(str)
17EC.bg.white(str)
18
19EC.br.black(str)
20EC.br.red(str)
21EC.br.green(str)
22EC.br.yellow(str)
23EC.br.blue(str)
24EC.br.magenta(str)
25EC.br.cyan(str)
26EC.br.white(str)
27
28EC.br.bg.black(str)
29EC.br.bg.red(str)
30EC.br.bg.green(str)
31EC.br.bg.yellow(str)
32EC.br.bg.blue(str)
33EC.br.bg.magenta(str)
34EC.br.bg.cyan(str)
35EC.br.bg.white(str)
36
37EC.reset(str)
38EC.bold(str)
39EC.faint(str)
40EC.italic(str)
41EC.underline(str)
42EC.inverse(str)
43EC.hidden(str)
44EC.strike(str)
45
46EC.remove(str)
47
48EC.log(str)
49EC.logBlack(str)
50EC.logRed(str)
51EC.logGreen(str)
52EC.logYellow(str)
53EC.logBlue(str)
54EC.logMagenta(str)
55EC.logCyan(str)
56EC.logWhite(str)
57
58EC.disabled = true|false
Browser Console
Usage is the same as above, and provides an additional UMD bundle (1.35 KB)
1<script src="path-to/eight-colors/dist/eight-colors.js"></script> 2<script> 3 const EC = window['eight-colors']; 4 console.log(EC.red('red string')); 5</script>
- firefox does not support
Links
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Score
3.4
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More