zero-pad
Should prepend a 0 to whole numbers less than equal 9 and larger than equal 0. Perfect use case for dates.
Installation
$ npm i --save zero-pad
Usage
const zeroPad = ; console; // 07console; // 09console; // -1console; // 0.1 // With an array as argumentconst arr = ;console; // [01, 10, 07] // Example with datesconst date = 2016 10 5;const pad = ; console; // 2016-10-05
Tests
$ npm test
Contribution
Contributions are appreciated.
License
MIT-licensed. See LICENSE.