complete-string (npm)
🔨 Complete string by any char. This repo is some kind of polyfill for ES2017 padStart.
npm install complete-string
Complete with any char:
CompleteString.withChar(' batman', 10, 'a') // => 'aaa batman'
Complete with 0
:
var date = new Date();
CompleteString.withZero(date.getMonth(), 2) // => '05'
npm test
npm run coverage
The MIT License @ 2014