Skip to content

Merge multiple directories in one. Precedence is based on arguments.

Notifications You must be signed in to change notification settings

DoclerLabs/collect-fs

Repository files navigation

Collect FS

Merge multiple directories in one. Precedence is based on arguments.

Install

npm i @dh-pub/collect-fs

Usage

collect-fs --source=/path/to/one/directory /path/to/another/directory --target=/path/to/target/directory

Available CLI Options

option description
--help Print help
--version Print current version
--source, -s Space-separated list of directories to merge
--target, -t Target directory

Node Usage

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>} */
  }
);

Caveats

  1. As of now empty directories are not copied over.

Contributing

Issues and PRs are welcome.

About

Merge multiple directories in one. Precedence is based on arguments.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published