complete-string

2.2.3 • Public • Published

complete-string (npm)

npm version downloads count travis-ci coveralls

🔨 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

Readme

Keywords

Package Sidebar

Install

npm i complete-string

Weekly Downloads

1

Version

2.2.3

License

MIT

Unpacked Size

14.6 kB

Total Files

7

Last publish

Collaborators

  • piecioshka