You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
rosh 459aece669 first commit 4 years ago
..
perf first commit 4 years ago
.travis.yml first commit 4 years ago
COPYING first commit 4 years ago
README.md first commit 4 years ago
index.d.ts first commit 4 years ago
index.js first commit 4 years ago
package.json first commit 4 years ago
test.js first commit 4 years ago

README.md

left-pad

String left pad

Build Status

Install

$ npm install left-pad

Usage

const leftPad = require('left-pad')

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

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

leftPad(1, 2, '0')
// => "01"

leftPad(17, 5, 0)
// => "00017"

NOTE: The third argument should be a single char. However the module doesn't throw an error if you supply more than one chars. See #28.

NOTE: Characters having code points outside of BMP plan are considered a two distinct characters. See #58.