Organize a messy, unorganized directory by time period and file type.
Prerequisite: Node.js v18+
$ npm i -g @fusionfroze/stratifyFirst, traverse to the directory you want to organize in your terminal.
$ stratify --dry monthYou also have quarter and year as options.
This command will show you which file goes where, printing the final structure without actually moving files.
It's always recommended to simulate the command before running it.
Important: These commands move actual files, so you should simulate the effect of the commands first.
Command structure -
$ stratify monthOr, whatever time period you want to organize the directory with (quarter, year).
This will organize the whole directory by the time period you ran the command with. This is the first level. At level two, the files will be organized by their type (e.g., PDFs, images, etc.).
After organizing a directory with the previous command, you can revert the file structure to its initial state by running this command -
$ stratify undoYou can also delete the history of an organized directory by running this command -
$ stratify clearImportant: If you delete the history of an organized directory, the undo command will not work in this directory.
(You will be asked for confirmation once, before actually deleting the history)