/ never-odd-or-even / back / node_modules / ansi-align /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]node_modules/2 years ago -  
[TXT]CHANGELOG.md40 years ago1.7K 
[   ]LICENSE40 years ago731  
[TXT]README.md40 years ago2.9K 
[   ]index.js40 years ago1.3K 
[   ]package.json2 years ago1.7K 
README.md

ansi-align

align-text with ANSI support for CLIs

Build Status Coverage Status Standard Version Greenkeeper badge

Easily center- or right- align a block of text, carefully ignoring ANSI escape codes.

E.g. turn this:

ansi text block no alignment :(

Into this:

ansi text block center aligned!

Install

npm install --save ansi-align
var ansiAlign = require('ansi-align')

API

ansiAlign(text, [opts])

Align the given text per the line with the greatest string-width, returning a new string (or array).

Arguments

Options

ansiAlign.center(text)

Alias for ansiAlign(text, { align: 'center' }).

ansiAlign.right(text)

Alias for ansiAlign(text, { align: 'right' }).

ansiAlign.left(text)

Alias for ansiAlign(text, { align: 'left' }), which is a no-op.

Similar Packages

License

ISC © Contributors

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80