Skip to content

piecioshka/complete-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

complete-string (npm)

npm version downloads count travis-ci

🔨 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

About

🔨 Complete string by any char. This repo is some kind of polyfill for ES2017 padStart.

Resources

Stars

Watchers

Forks