pad

September 26, 2012 ยท View on GitHub

Trims string whitespace.

Installation

$ npm install pad-component
$ component install component/pad

API

pad(str, len[, char])

Pad str on both sides to the given len, with optional char defaulting to a space.

pad.left(str, len[, char])

Pad str on the left to the given len with optional char.

pad.right(str, len[, char])

Pad str on the right to the given len with optional char.

License

MIT

Contents

  1. 1Installation
  2. 2API
  3. 2.1pad(str, len[, char])
  4. 2.2pad.left(str, len[, char])
  5. 2.3pad.right(str, len[, char])
  6. 3License