Quick start
Node.js 22 or newer is required. Run the CLI without a global installation:
npx foldnize --root=./photos --mode=replace --dry-runReview the output, remove --dry-run, and run it again when you are ready.
Common commands
Prefix the original filename with its EXIF date
npx foldnize --root=./photos --mode=prefix --dry-runReplace filenames and create Year/Month folders
npx foldnize --root=./photos --mode=replace --year-month --dry-runAdd a descriptive custom name
npx foldnize --root=./photos --mode=custom \
--custom-name=vacation --year-month --dry-runCLI options
| Option | Purpose |
|---|---|
--root=PATH | Folder to scan; defaults to the current folder. |
--mode=MODE | Use prefix, replace, or custom naming. |
--custom-name=NAME | Name used by custom mode. |
--year-month | Move files into YYYY/MM/. |
--no-subfolders | Scan only the top level. |
--dry-run | Preview without writing files. |
Use Foldnize as a TypeScript library
npm install foldnizeimport { organizeFolder, Mode } from "foldnize";
organizeFolder({
root: "/Users/you/Pictures",
mode: Mode.REPLACE,
organizeIntoYearMonth: true,
scanSubfolders: true,
dryRun: true,
});