filename-to-dir
v1.0.0
Published
Use filenames to create folders schema
Downloads
4
Maintainers
Readme
filename-to-dir
Use filenames to create folders schema.
Installation
npm install filename-to-dir --save
Usage
namedir(glob,dest,options,callback)
Example
var namedir = require('filename-to-dir');
namedir('**/*.png','./destFolder',function(){
});
// this
// heroes_$_lulu_$_hit_$_001.png
// heroes_$_lulu_$_hit_$_002.png
// heroes_$_janna_$_walk_$_001.png
// return
// destFolder/heroes/lulu/hit/001.png
// destFolder/heroes/lulu/hit/002.png
// destFolder/heroes/janna/walk/001.png
// or
namedir(['**/*.png'],'./destFolder',{split:'@'},function(){
});
// with all options
namedir(['**/*.png'],'./destFolder',{split:'@'},function(err,data){
});
Options
CLI
npm install filename-to-dir -g
Usage
$ namedir <glob> <dest>
Options
--split Split string. Default: "_$_"
Examples
namedir "**/*.png"
namedir "**/*.png" destFolder/
namedir "**/*.png" "destFolder/" --split "@"
Check Also
License
MIT