Merge multiple directories in one. Precedence is based on arguments.
npm i @dh-pub/collect-fscollect-fs --source=/path/to/one/directory /path/to/another/directory --target=/path/to/target/directory| option | description |
|---|---|
--help |
Print help |
--version |
Print current version |
--source, -s |
Space-separated list of directories to merge |
--target, -t |
Target directory |
import collectFs from "@dh-pub/collect-fs";
collectFs(
["/path/to/one/directory", "/path/to/another/directory"],
"/path/to/target/directory", function onEvent(eventData) {
/** @eventData {type: "add" | "change" | "unlink", payload: Record<string, unknown>} */
}
);- As of now empty directories are not copied over.
Issues and PRs are welcome.