sharpyy
v1.1.0
Published
A package that allows windows to have pretty colors in the terminal.
Downloads
72
Maintainers
Readme
Because chalk does not work in windows terminals...
Highlights
- Fast
- Lightweight
- Easy to use
- Customizable
- TypeScript Types
- ESM & CJS support
- Works on all machines
- No dependencies
Install
npm install sharpyy
How-To-Use
import { Style } from 'sharpyy'
// Anything passed after the first argument is a style. You can combine every style available.
sharpyy(text:string, ...style:Array<keyof typeof Style | Style>)
// Style is an enum and you can pass both a string value as well as a enum key.
Usage
// ESM
import sharpyy from 'sharpyy';
console.log(sharpyy('Hello, World!', 'invisible'));
// Use tx<Colorname> for text color.
console.log(sharpyy('Hello, World!', 'txBlue'));
// Use bg<Colorname> for background color.
console.log(sharpyy('Hello, World!', 'bgBlue'));
// It does not stop at colors...
console.log(sharpyy('Hello, World!', 'strikethrough'));
console.log(sharpyy('Hello, World!', 'underline'));
console.log(sharpyy('Hello, World!', 'italic'));
console.log(sharpyy('Hello, World!', 'dim'));
// combine multiple effects
console.log(sharpyy('Hello, World!', 'txRed', 'bold', 'underline', 'inverse'));
// You like rainbows?
console.log(sharpyy('Hello, World!', 'txRainbow', 'bold', 'underlines', 'italic'));
console.log(sharpyy('Hello, World!', 'bgRainbow', 'bold', 'underlines', 'italic'));
// CJS
const { default: sharpyy } = require('sharpyy');
console.log(sharpyy('Hello, World!', 'invisible'));
// Use tx<Colorname> for text color.
console.log(sharpyy('Hello, World!', 'txBlue'));
// Use bg<Colorname> for background color.
console.log(sharpyy('Hello, World!', 'bgBlue'));
// It does not stop at colors...
console.log(sharpyy('Hello, World!', 'strikethrough'));
console.log(sharpyy('Hello, World!', 'underline'));
console.log(sharpyy('Hello, World!', 'italic'));
console.log(sharpyy('Hello, World!', 'dim'));
// combine multiple effects
console.log(sharpyy('Hello, World!', 'txRed', 'bold', 'underline', 'inverse'));
// You like rainbows?
console.log(sharpyy('Hello, World!', 'txRainbow', 'bold', 'underlines', 'italic'));
console.log(sharpyy('Hello, World!', 'bgRainbow', 'bold', 'underlines', 'italic'));
Styles
- normal
- bold
- dim
- italic
- underline
- inverse
- invisible
- strikethrough
- underlines
Text Colors
- txGray
- txRed
- txGreen
- txYellow
- txBlue
- txMagenta
- txCyan
- txWhite
- txRainbow
Background Colors
- bgGray
- bgRed
- bgGreen
- bgYellow
- bgBlue
- bgMagenta
- bgCyan
- bgWhite
- bgRainbow