fs-vacuum

WebJar for fs-vacuum

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

fs-vacuum
Last Version

Last Version

1.2.10
Release Date

Release Date

Type

Type

jar
Description

Description

fs-vacuum
WebJar for fs-vacuum
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/npm/fs-vacuum

Download fs-vacuum

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/fs-vacuum/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>fs-vacuum</artifactId>
    <version>1.2.10</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/fs-vacuum/
implementation 'org.webjars.npm:fs-vacuum:1.2.10'
// https://jarcasting.com/artifacts/org.webjars.npm/fs-vacuum/
implementation ("org.webjars.npm:fs-vacuum:1.2.10")
'org.webjars.npm:fs-vacuum:jar:1.2.10'
<dependency org="org.webjars.npm" name="fs-vacuum" rev="1.2.10">
  <artifact name="fs-vacuum" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='fs-vacuum', version='1.2.10')
)
libraryDependencies += "org.webjars.npm" % "fs-vacuum" % "1.2.10"
[org.webjars.npm/fs-vacuum "1.2.10"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : graceful-fs jar [4.1.2,5)
org.webjars.npm : path-is-inside jar [1.0.1,2)
org.webjars.npm : rimraf jar [2.5.2,3)

Project Modules

There are no modules declared in this project.

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

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", options, 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.
org.webjars.npm

npm

node package manager

Versions

Version
1.2.10
1.2.9
1.2.7