sidenote

1.0.0 • Public • Published

sidenote stable

Given a list of string pairs, align each pair to the left and to the right.

Usage

NPM

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 to .
  • opts.distance: add additional space between each column. Defaults to 1.

License

MIT. See LICENSE.md for details.

Package Sidebar

Install

npm i sidenote

Weekly Downloads

7

Version

1.0.0

License

MIT

Last publish

Collaborators

  • hughsk