file-tree-transform
A tool for recursively walking through a folder and modifying it's files using a transformer function.
const transform = ; { const newContent = `This file was converted!\n`; const newName = `.converted`; return output: newContent // Content of the new file name: newName // Filename of the new file (optional) ;} ;
Example
INPUT | OUTPUT
--------------------------------------------------|--------------------------------------------------
input-folder | output-folder
├── bar.txt | ├── bar.txt.converted
├── foo.txt | ├── foo.txt.converted
└── other-file | └── other-file
└── baz.txt | └── baz.txt.converted
|
--------------------------------------------------|--------------------------------------------------
|
(inside bar.txt) | (inside bar.txt.converted)
|
content content content content content content | This file was converted!
content content content content content content | content content content content content content
| content content content content content content
See GH /example