This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

format-txt
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Format text when printing to the terminal!

/*
 *  Examples
 */
const { logln } = require("format-txt");

logln("Text with no formatting");
logln("<red>Red text</red>");
logln("<red;ul>Underlined red text</red;ul>");
logln("<blue;ul>Underlined blue text</blue> Underlined text</ul>");
logln("--\\> <yellow>Yellow text</yellow> \\<--");

Every > or < which isn't being used for formatting must be prefixed with \\

Functions:

  • formatTxt(txt)
    Formats then returns the supplied text.
  • log(txt)
    Formats then logs the supplied text.
  • logln(txt)
    Formats then logs the supplied text with a newline.

Available formats:

Text Formats:

  • bold
  • dim
  • italic
  • underline / ul
  • flashing / flash
  • strikethrough / st

Text Colours:

  • black
  • red
  • green
  • yellow
  • blue
  • purple
  • cyan
  • white

Hight Intensity Text Colours:

  • blackH
  • redH
  • greenH
  • yellowH
  • blueH
  • purpleH
  • cyanH
  • whiteH

Background colours:

  • blackB
  • redB
  • greenB
  • yellowB
  • blueB
  • purpleB
  • cyanB
  • whiteB

High Intensity Background Colours:

  • blackHB
  • redHB
  • greenHB
  • yellowHB
  • blueHB
  • purpleHB
  • cyanHB
  • whiteHB

Package Sidebar

Install

npm i format-txt

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

8.55 kB

Total Files

5

Last publish

Collaborators

  • james-bennett-295