Socket
Socket
Sign inDemoInstall

ansi-format

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ansi-format

Simple ansi formatter


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

ansi-format Build Status codecov

Simple ansi formatter

Install

$ npm install ansi-format

Usage

const ansiFormat = require('ansi-format');

ansiFormat('bold');
//=> '\x1b[1m'

ansiFormat(['red', 'green']);
//=> '\x1b[31;32m'

API

ansiFormat(styles)

input

Type: string, array

An array or a string representing styles

Supported styles
NameValue
reset\u001b[0m
bold\u001b[1m
italic\u001b[3m
underline\u001b[4m
fontDefault\u001b[10m
font2\u001b[11m
font3\u001b[12m
font4\u001b[13m
font5\u001b[14m
font6\u001b[15m
imageNegative\u001b[7m
imagePositive\u001b[27m
black\u001b[30m
red\u001b[31m
green\u001b[32m
yellow\u001b[33m
blue\u001b[34m
magenta\u001b[35m
cyan\u001b[36m
white\u001b[37m
gray\u001b[90m
bg-black\u001b[40m
bg-red\u001b[41m
bg-green\u001b[42m
bg-yellow\u001b[43m
bg-blue\u001b[44m
bg-magenta\u001b[45m
bg-cyan\u001b[46m
bg-white\u001b[47m
bg-gray\u001b[100m

License

MIT © Tobias Herber

FAQs

Last updated on 03 Feb 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc