Socket
Socket
Sign inDemoInstall

complete-string

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    complete-string

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


Version published
Maintainers
1
Install size
14.3 kB
Created

Readme

Source

complete-string (npm)

npm version downloads count travis-ci coveralls

:hammer: 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

Keywords

FAQs

Last updated on 10 Sep 2019

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc