Function vacuum

  • Remove the empty branches of a directory tree, optionally up to (but not including) a specified base directory. Optionally nukes the leaf directory.

    Parameters

    • directory: string

      Leaf node to remove. Must be a directory, symlink, or file.

    • Optional options: VacuumOptions

      Options for fs-vacuum.

    Returns Promise<void>

    Example: ``` var logger = require("npmlog"); var vacuum = require("fs-vacuum"); var options = { base : "/path/to/my/tree/root", purge : true, log : logger.silly.bind(logger, "myCleanup") }; // Assuming there are no other files or directories in "out", "to", or "my", // the final path will just be "/path/to/my/tree/root". vacuum("/path/to/my/tree/root/out/to/my/files", function (error) { if (error) console.error("Unable to cleanly vacuum:", error.message); }); ```

  • Parameters

    Returns void

Generated using TypeDoc