String left pad.
P.S: I've unpublished it from NPM.
$ npm install azer/left-pad
leftpad = require('left-pad')
leftpad('foo', 5)
// => " foo"
leftpad('foobar', 6)
// => "foobar"
leftpad(1, 2, 0)
// => "01"
String left pad.
P.S: I've unpublished it from NPM.
$ npm install azer/left-pad
leftpad = require('left-pad')
leftpad('foo', 5)
// => " foo"
leftpad('foobar', 6)
// => "foobar"
leftpad(1, 2, 0)
// => "01"