]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/README.md
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / fs-vacuum / README.md
diff --git a/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/README.md b/org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/fs-vacuum/README.md
new file mode 100644 (file)
index 0000000..df31243
--- /dev/null
@@ -0,0 +1,33 @@
+# fs-vacuum
+
+Remove the empty branches of a directory tree, optionally up to (but not
+including) a specified base directory. Optionally nukes the leaf directory.
+
+## Usage
+
+```javascript
+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);
+});
+```
+# vacuum(directory, options, callback)
+
+* `directory` {String} Leaf node to remove. **Must be a directory, symlink, or file.**
+* `options` {Object}
+  * `base` {String} No directories at or above this level of the filesystem will be removed.
+  * `purge` {Boolean} If set, nuke the whole leaf directory, including its contents.
+  * `log` {Function} A logging function that takes `npmlog`-compatible argument lists.
+* `callback` {Function} Function to call once vacuuming is complete.
+  * `error` {Error} What went wrong along the way, if anything.