complete-string (npm)

:hammer: Complete string by any char. This repo is some kind of polyfill for ES2017 padLeft.
Install
$ npm install complete-string
API
withChar(string: string, length: number, char: string)
Complete with any char:
CompleteString.withChar(' batman', 10, 'a')
withZero(string: string, length: number)
Complete with 0
:
var date = new Date();
CompleteString.withZero(date.getMonth(), 2)
Unit tests
To run unit tests (written in Jasmine) execute:
$ npm test
Code coverage
Use Istanbul to get code coverage ratio.
$ npm run coverage
License
The MIT License @ 2014