npm

Don't miss out on this year's npm Pride t-shirt designs!Order your favorites here »

padleft

0.2.0 • 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 )

install

npm i padleft

Downloadsweekly downloads

11

version

0.2.0

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability