left-pad

String left pad

WTFPL 15 个版本
安装
npm install left-pad
yarn add left-pad
pnpm add left-pad
bun add left-pad
README

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.

版本列表
1.3.0 2018-04-09
1.2.0 2017-11-17
1.1.3 2016-10-01
1.1.2 2016-09-24
1.1.1 2016-07-08
1.1.0 2016-05-01
1.0.2 2016-04-13
1.0.1 2016-03-23
1.0.0 2016-03-22
0.0.9 2016-03-22
0.0.4 2015-05-20
0.0.3 2016-03-22
0.0.2 2014-08-15
0.0.1 2014-08-14
0.0.0 2014-03-14