left-pad icon indicating copy to clipboard operation
left-pad copied to clipboard

String left pad

left-pad

String left pad.

Travis Status

Install

$ npm install left-pad

Usage

leftpad = require('left-pad')

leftpad('foo', 5)
// => "  foo"

leftpad('foobar', 6)
// => "foobar"

leftpad(1, 2, 0)
// => "01"