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.
 
 
 
 
rpm-mcarman b9f7ec4306 First Commit 3 年之前
..
perf First Commit 3 年之前
.travis.yml First Commit 3 年之前
COPYING First Commit 3 年之前
README.md First Commit 3 年之前
index.d.ts First Commit 3 年之前
index.js First Commit 3 年之前
package.json First Commit 3 年之前
test.js First Commit 3 年之前

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.