🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

complete-string

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

complete-string

CompleteString string by any char. This repo is some kind of polyfill for ES7 padLeft.

2.1.2
Source
npm
Version published
Weekly downloads
27
58.82%
Maintainers
1
Weekly downloads
 
Created
Source

complete-string (npm)

npm version Travis Coverage Status

: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') // => 'aaa batman'

withZero(string: string, length: number)

Complete with 0:

var date = new Date();
CompleteString.withZero(date.getMonth(), 2) // => '05'

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

Keywords

complete

FAQs

Package last updated on 29 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts