padleft

0.2.1 • Public • Published

padleft

Simple JS String padLeft implementation

This adds a padLeft fn to String's prototype Also adds a padRight fn to same prototype

1. Install & configure

npm install --save padleft

require('padleft');

2. Usage

'4'.padLeft(4, '0'); // 0004
 
'4'.padRight(4, '0'); // 4000

Spec

padLeft( length, charToAdd )

padRight( length, charToAdd )

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.1
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.1
    4
  • 0.2.0
    1
  • 0.1.0
    1

Package Sidebar

Install

npm i padleft

Weekly Downloads

6

Version

0.2.1

License

none

Unpacked Size

37.5 kB

Total Files

6

Last publish

Collaborators

  • szanata