/left-pad

String left pad

Primary LanguageJavaScript

left-pad

String left pad.

P.S: I've unpublished it from NPM.

Install

$ npm install azer/left-pad

Usage

leftpad = require('left-pad')

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

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

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