2.2.3 • Published 5 years ago

complete-string v2.2.3

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

complete-string (npm)

npm version downloads count travis-ci coveralls

:hammer: Complete string by any char. This repo is some kind of polyfill for ES2017 padStart.

Install

npm install complete-string

API

withChar(string: string, length: number, char: string)

Complete with any char:

CompleteString.withChar(' batman', 10, 'a') // => 'aaa batman'

withZero(string: string, length: number)

Complete with 0:

var date = new Date();
CompleteString.withZero(date.getMonth(), 2) // => '05'

Unit tests

npm test

Code coverage

npm run coverage

License

The MIT License @ 2014

2.2.3

5 years ago

2.2.2

5 years ago

2.2.0

5 years ago

2.1.2

8 years ago

2.1.1

8 years ago

2.1.0

8 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago