node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey »

zerofill

Zerofill

Zero-pad a number to the given size. Saves you repeating a whopping seven lines of code everywhere.

var zeroFill = require('zerofill');
 
zeroFill(1, 3); // '001' 

License: MIT.