flatten-dirname
v1.0.2
Published
Flatten files to from relative folders. But keep dirname on filename.
Downloads
7
Maintainers
Readme
flatten-dirname
Flatten files to from relative folders. But keep dirname on filename.
Installation
npm install flatten-dirname --save
Usage
fdname(glob,dest,options,callback)
Example
var fdname = require('flatten-dirname');
fdname('**/*.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
fdname(['**/*.png'],'./destFolder',{split:'@'},function(){
});
// with all options
fdname(['**/*.png'],'./destFolder',{split:'@'},function(err,data){
});
Options
CLI
npm install flatten-dirname -g
Usage
$ fdname <glob> <dest>
Options
--split Split string. Default: "_$_"
Examples
fdname "**/*.png"
fdname "**/*.png" destFolder/
fdname "**/*.png" "destFolder/" --split "@"
Check Also
License
MIT