tynt

A tactile color library for Node.js' console.

  • tynt

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
tynt
1.2.04 years ago4 years agoMinified + gzip package size for tynt in KB

Readme

Tynt

A tactile color library for Node.js' console.

Tynt is very easy to use, here is a quick example:
var tynt = require("tynt");

console.log("The blue " + tynt.Blue("Chicken") + " ate a red " + tynt.Red("seed") + ".")

Installation

Using NPM:
npm i tynt

List of Colors

Here is a reference of pre-defined colors that you don't need to add yourself.
tynt.Reset
tynt.Bright
tynt.Dim
tynt.Underscore
tynt.Blink
tynt.Reverse
tynt.Hidden

tynt.Black
tynt.Red
tynt.Green
tynt.Yellow
tynt.Blue
tynt.Magenta
tynt.Cyan
tynt.White

tynt.BgBlack
tynt.BgRed
tynt.BgGreen
tynt.BgYellow
tynt.BgBlue
tynt.BgMagenta
tynt.BgCyan
tynt.BgWhite

Adding Presets/Prefixes

tynt.add("name","John")

console.log("Hello, " + tynt.name("") + ".") // Hello, John.
tynt.add("err",tynt.Red("Error: "))

console.log(tynt.err("Well this sucks.")) // Error: Well this sucks.

Variables

Tynt has built in variables to help when making Presets/Prefixes.
// {text}
tynt.add("Hello","Hello, {text}!")

console.log(tynt.Hello("John")) // Hello, John!
// Before, without variables (NOT SUPPORTED BY 1.0)
tynt.add("Hello","Hello, ")

console.log(tynt.Hello("James") + "!") // Hello, James!