complete-string
v3.0.0
Published
🔨 Complete string by any char
Downloads
215
Maintainers
Readme
complete-string
🔨 Complete string by any char.
WARNING: This repo is shim for
String.prototype.padStart
(defined in ES2017 spec).
Install
npm install complete-string
Usage
// 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'
License
The MIT License @ 2014-2024