padding
padding is a tiny node.js module for zero padding
- rename files with zero padding automatically
- zero configuration
- by zero padding, you get files whose name have same length
- you can use this as both cli tool and in your code
- dotfiles (like
.DS_Store
) are not supported currently
Example
files without any prefix
➜ example1 ✗ ls -11.jpg10.jpg101.jpg2.jpg209.jpg77.jpg ➜ example1 ✗ paddingadd padding ➜ example1 ✗ ls -1001.jpg002.jpg010.jpg077.jpg101.jpg209.jpg
- simple exmaple
- In this example, the longest file name is
101.jpg
or209.jpg
. - So padding changes all target files to have same length (7characters).
files which have common prefix
➜ example2 ✗ ls -1sample1.jpgsample10.jpgsample101.jpgsample2.jpgsample209.jpgsample77.jpg➜ example2 ✗ paddingadd padding➜ example2 ✗ ls -1sample001.jpgsample002.jpgsample010.jpgsample077.jpgsample101.jpgsample209.jpg
sample
is prefix in this examplepadding
works well with prefix
Installation
If you want to use command line tool, you should install globally.
npm install -g padding
Also you can use padding in your project.
npm install padding --save
Public API
License
MIT