{"id":15290270,"url":"https://github.com/npm/fs-vacuum","last_synced_at":"2025-10-07T03:32:32.704Z","repository":{"id":18118035,"uuid":"21193455","full_name":"npm/fs-vacuum","owner":"npm","description":"Remove empty branches in a directory tree.","archived":true,"fork":false,"pushed_at":"2023-02-07T04:56:18.000Z","size":62,"stargazers_count":8,"open_issues_count":0,"forks_count":8,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-10-01T16:06:48.765Z","etag":null,"topics":["npm-cli"],"latest_commit_sha":null,"homepage":"https://npmjs.org/package/fs-vacuum","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/npm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-25T06:57:30.000Z","updated_at":"2023-08-25T22:40:21.000Z","dependencies_parsed_at":"2023-02-19T15:05:30.341Z","dependency_job_id":null,"html_url":"https://github.com/npm/fs-vacuum","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Ffs-vacuum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Ffs-vacuum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Ffs-vacuum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Ffs-vacuum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/npm","download_url":"https://codeload.github.com/npm/fs-vacuum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235586077,"owners_count":19014028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["npm-cli"],"created_at":"2024-09-30T16:06:41.515Z","updated_at":"2025-10-07T03:32:27.422Z","avatar_url":"https://github.com/npm.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fs-vacuum\n\nRemove the empty branches of a directory tree, optionally up to (but not\nincluding) a specified base directory. Optionally nukes the leaf directory.\n\n## Usage\n\n```javascript\nvar logger = require(\"npmlog\");\nvar vacuum = require(\"fs-vacuum\");\n\nvar options = {\n  base  : \"/path/to/my/tree/root\",\n  purge : true,\n  log   : logger.silly.bind(logger, \"myCleanup\")\n};\n\n/* Assuming there are no other files or directories in \"out\", \"to\", or \"my\",\n * the final path will just be \"/path/to/my/tree/root\".\n */\nvacuum(\"/path/to/my/tree/root/out/to/my/files\", options, function (error) {\n  if (error) console.error(\"Unable to cleanly vacuum:\", error.message);\n});\n```\n# vacuum(directory, options, callback)\n\n* `directory` {String} Leaf node to remove. **Must be a directory, symlink, or file.**\n* `options` {Object}\n  * `base` {String} No directories at or above this level of the filesystem will be removed.\n  * `purge` {Boolean} If set, nuke the whole leaf directory, including its contents.\n  * `log` {Function} A logging function that takes `npmlog`-compatible argument lists.\n* `callback` {Function} Function to call once vacuuming is complete.\n  * `error` {Error} What went wrong along the way, if anything.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm%2Ffs-vacuum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpm%2Ffs-vacuum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm%2Ffs-vacuum/lists"}