sidenote
v1.0.0
Published
Given a list of string pairs, align each pair either right or left
Downloads
44
Maintainers
Readme
sidenote
Given a list of string pairs, align each pair to the left and to the right.
Usage
rows = sidenote(list, [opts])
Accepts a list
of string pairs in the following format:
var list = [
['left hand side', '{right hand side}'],
['another', 'piece of text']
]
And returns properly aligned rows
like so:
return [
'left hand side {right hand side}',
'another piece of text'
]
Optionally, you can pass in the following options:
opts.character
: the character with which to pad the gaps between strings. Defaults toopts.distance
: add additional space between each column. Defaults to 1.
License
MIT. See LICENSE.md for details.