Command line

syncdir

Global install gives you syncdir. Source and target can be relative or absolute. Watch is off until you pass -w.

npm i sync-directory -g
syncdir <from> <to> [options]
syncdir ./aaa ./bbb -w

Flags

FlagAPI equivalentDefaultWhat it does
-w, --watchwatchfalseKeep syncing as files change.
--quiet—falseHide non-essential logs.
--exclude <strings...>exclude—Skip paths, e.g. syncdir a b --exclude node_modules package-lock.json
-si, --skipInitialSyncskipInitialSyncfalseDo not copy the tree first; only watch later events.
-nd, --nodeepnodeepfalseOnly the first level of files and folders. Useful on huge trees.
-do, --deleteOrphaneddeleteOrphanedfalseDelete target files that are gone (or excluded) from source.
-hardlink, --hardlinktype: 'hardlink'copyCreate hardlinks instead of copying bytes.
-symlink, --symlinkstaySymlinkfalsePreserve symlink folders as the same symlink in the target.