Gathering detailed insights and metrics for ansi-styles-template
Gathering detailed insights and metrics for ansi-styles-template
Gathering detailed insights and metrics for ansi-styles-template
Gathering detailed insights and metrics for ansi-styles-template
npm install ansi-styles-template
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
30,866
Last Day
6
Last Week
22
Last Month
427
Last Year
7,356
MIT License
1 Stars
7 Commits
2 Watchers
2 Branches
1 Contributors
Updated on Feb 20, 2025
Minified
Minified + Gzipped
Latest Version
1.0.0
Package Id
ansi-styles-template@1.0.0
Size
3.67 kB
NPM Version
3.10.8
Node Version
6.8.0
Cumulative downloads
Total Downloads
Last Day
-70%
6
Compared to previous day
Last Week
-87.8%
22
Compared to previous week
Last Month
-45.8%
427
Compared to previous month
Last Year
371.2%
7,356
Compared to previous year
1
1
Use ANSI styles in template notation
1npm install ansi-styles-template
1const {template} = require('ansi-styles-template'); 2 3const str = '{red}Bloody..{/red}'; 4 5console.log(template(str)); // -> "\u001b[31mBloody..\u001b[39m"
The styles available as tags conform to ansy-styles.
Or dump replacementMap
in the following way, you can confirm more certainly.
1const {replacementMap} = require('ansi-styles-template'); 2 3console.log(replacementMap); 4// -> 5// Map { 6// 'reset' => { opener: '\u001b[0m', closer: '\u001b[0m' }, 7// 'bold' => { opener: '\u001b[1m', closer: '\u001b[22m' }, 8// 'dim' => { opener: '\u001b[2m', closer: '\u001b[22m' }, 9// 'italic' => { opener: '\u001b[3m', closer: '\u001b[23m' }, 10// 'underline' => { opener: '\u001b[4m', closer: '\u001b[24m' }, 11// 'inverse' => { opener: '\u001b[7m', closer: '\u001b[27m' }, 12// 'hidden' => { opener: '\u001b[8m', closer: '\u001b[28m' }, 13// 'strikethrough' => { opener: '\u001b[9m', closer: '\u001b[29m' }, 14// 'black' => { opener: '\u001b[30m', closer: '\u001b[39m' }, 15// 'red' => { opener: '\u001b[31m', closer: '\u001b[39m' }, 16// 'green' => { opener: '\u001b[32m', closer: '\u001b[39m' }, 17// 'yellow' => { opener: '\u001b[33m', closer: '\u001b[39m' }, 18// 'blue' => { opener: '\u001b[34m', closer: '\u001b[39m' }, 19// 'magenta' => { opener: '\u001b[35m', closer: '\u001b[39m' }, 20// 'cyan' => { opener: '\u001b[36m', closer: '\u001b[39m' }, 21// 'white' => { opener: '\u001b[37m', closer: '\u001b[39m' }, 22// 'gray' => { opener: '\u001b[90m', closer: '\u001b[39m' }, 23// 'redBright' => { opener: '\u001b[91m', closer: '\u001b[39m' }, 24// 'greenBright' => { opener: '\u001b[92m', closer: '\u001b[39m' }, 25// 'yellowBright' => { opener: '\u001b[93m', closer: '\u001b[39m' }, 26// 'blueBright' => { opener: '\u001b[94m', closer: '\u001b[39m' }, 27// 'magentaBright' => { opener: '\u001b[95m', closer: '\u001b[39m' }, 28// 'cyanBright' => { opener: '\u001b[96m', closer: '\u001b[39m' }, 29// 'whiteBright' => { opener: '\u001b[97m', closer: '\u001b[39m' }, 30// 'bgBlack' => { opener: '\u001b[40m', closer: '\u001b[49m' }, 31// 'bgRed' => { opener: '\u001b[41m', closer: '\u001b[49m' }, 32// 'bgGreen' => { opener: '\u001b[42m', closer: '\u001b[49m' }, 33// 'bgYellow' => { opener: '\u001b[43m', closer: '\u001b[49m' }, 34// 'bgBlue' => { opener: '\u001b[44m', closer: '\u001b[49m' }, 35// 'bgMagenta' => { opener: '\u001b[45m', closer: '\u001b[49m' }, 36// 'bgCyan' => { opener: '\u001b[46m', closer: '\u001b[49m' }, 37// 'bgWhite' => { opener: '\u001b[47m', closer: '\u001b[49m' }, 38// 'bgBlackBright' => { opener: '\u001b[100m', closer: '\u001b[49m' }, 39// 'bgRedBright' => { opener: '\u001b[101m', closer: '\u001b[49m' }, 40// 'bgGreenBright' => { opener: '\u001b[102m', closer: '\u001b[49m' }, 41// 'bgYellowBright' => { opener: '\u001b[103m', closer: '\u001b[49m' }, 42// 'bgBlueBright' => { opener: '\u001b[104m', closer: '\u001b[49m' }, 43// 'bgMagentaBright' => { opener: '\u001b[105m', closer: '\u001b[49m' }, 44// 'bgCyanBright' => { opener: '\u001b[106m', closer: '\u001b[49m' }, 45// 'bgWhiteBright' => { opener: '\u001b[107m', closer: '\u001b[49m' } }
str: string
options.leftBrace: string
"{"
options.rightBrace: string
"}"
options.strict: boolean
false
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/7 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-03-24
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