🔨 Complete string by any char.
WARNING: This repo is shim for
String.prototype.padStart
(defined in ES2017 spec).
Installation:
npm install complete-string
// CommonJS
const CompleteString = require('complete-string');
// or ES Modules
import * as CompleteString from 'complete-string';
CompleteString.withChar(' batman', 10, 'a') // => 'aaa batman'
CompleteString.withZero('5', 2) // => '05'
// or import particular functions
import { withChar, withZero } from "complete-string";
withChar(' zorro', 10, 'z') // => 'zzzz zorro'
withZero('6', 2) // => '06'
The MIT License @ 2014