Repository
Current version released
5 years ago
Install
import { rang } from "https://deno.land/x/rang@0.0.6/mod.js";Usage
Rang comes with an easy to use composable API where you just chain and nest the styles you want.
import { rang } from "https://deno.land/x/rang@0.0.6/mod.js";
const log = console.log;
// Combine styled and normal strings
log(rang.blue('Hello') + ' World' + rang.red('!'));
// Compose multiple styles using the chainable API
log(rang.blue.bgRed.bold('Hello world!'));
// ES2015 template literal
log(`
CPU: ${rang.red('90%')}
RAM: ${rang.green('40%')}
DISK: ${rang.yellow('70%')}
`);
log(rang`Hello { yellow world }`);
log(rang`My name is { cyan.bold Nevis }`);Modifiers
bold- Make text bold.dim- Emitting only a small amount of light.underline- Make text underline. (Not widely supported)reverse- Inverse background and foreground colors.hidden- Prints the text, but makes it invisible.
Colors
blackredgreenyellowbluemagentacyanwhiteblackBright(alias:gray,grey)redBrightgreenBrightyellowBrightblueBrightmagentaBrightcyanBrightwhiteBright
Background colors
bgBlackbgRedbgGreenbgYellowbgBluebgMagentabgCyanbgWhitebgBlackBright(alias:bgGray,bgGrey)bgRedBrightbgGreenBrightbgYellowBrightbgBlueBrightbgMagentaBrightbgCyanBrightbgWhiteBright