{"id":16531177,"url":"https://github.com/noahweasley/clean-sweep","last_synced_at":"2025-04-06T18:45:46.460Z","repository":{"id":184048413,"uuid":"671238844","full_name":"noahweasley/Clean-Sweep","owner":"noahweasley","description":"A Node JS library that delete all empty files and folders in a target directory.","archived":false,"fork":false,"pushed_at":"2024-06-12T17:25:54.000Z","size":48,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T01:35:38.204Z","etag":null,"topics":["clean","directories","directory","empty","erase","file","files","filesystem","sweep"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/clean-sweep","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noahweasley.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-26T21:37:28.000Z","updated_at":"2024-06-12T17:18:49.000Z","dependencies_parsed_at":"2023-07-26T23:04:28.093Z","dependency_job_id":"ed140a98-e679-4ea8-8dfb-a46a0a7b6347","html_url":"https://github.com/noahweasley/Clean-Sweep","commit_stats":null,"previous_names":["noahweasley/empty-erase","noahweasley/vaporize","noahweasley/clean-sweep"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahweasley%2FClean-Sweep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahweasley%2FClean-Sweep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahweasley%2FClean-Sweep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahweasley%2FClean-Sweep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noahweasley","download_url":"https://codeload.github.com/noahweasley/Clean-Sweep/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247535249,"owners_count":20954571,"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":["clean","directories","directory","empty","erase","file","files","filesystem","sweep"],"created_at":"2024-10-11T18:08:05.705Z","updated_at":"2025-04-06T18:45:46.422Z","avatar_url":"https://github.com/noahweasley.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Clean Sweep\n\n![license](https://img.shields.io/github/license/noahweasley/clean-sweep) ![GitHub tag (with filter)](https://img.shields.io/github/v/tag/noahweasley/clean-sweep?label=Latest%20release\u0026color=yellow) ![npm downloads](https://img.shields.io/npm/dw/clean-sweep?label=NPM%20downloads\u0026color=red)\n\n\u003e Delete all files and folders in a target directory, according to a threshHold file size.\n\n## How to Use\n\n### Installation (as a script)\n\n```bash\nnpm install clean-sweep -g\n```\n\n### Usage (as a script)\n\n```bash\nclean-sweep \u003cpath/to/directory\u003e -v -t \u003cbytes\u003e\n# OR\ncsw \u003cpath/to/directory\u003e -v -t \u003cbytes\u003e\n\n```\n\n- The first argument is the path to the directory in which the operation would be performed, and is required!\n- The remaining are optional\n\n### Optional Parameters\n\n-v: prints out the operation of the sweep function to console if specified\n-t: specifies the threshold. Threshold here is the file size(in bytes), in which with, files with sizes below this threshold, are deleted\n\n### Example\n\n```bash\nclean-sweep ./music\nclean-sweep ./music -v\nclean-sweep ./music -t 200\n# OR\ncsw ./music\ncsw ./music -v\ncsw ./music -t 200\n```\n\n### Installation (in code)\n\n```bash\nnpm install clean-sweep --save\n```\n\n### Usage (in code, synchronously)\n\n```javascript\nconst cleanSweep = require(\"clean-sweep\");\nconst fileDirectory = \"\u003creplace file directory here\u003e\";\n\ntry {\n  cleanSweep.sweepSync(fileDirectory, {\n    /* specify if operation info should be printed to console, defaults to false */\n    verbose: true,\n    /* all files with size(in byte) below this thresh hold are deleted, defaults to 0 */\n    threshHold: 200\n  });\n} catch (err) {\n  if (err.code == \"ENOENT\") {\n    console.error(\"Directory does not exist\");\n  } else {\n    console.error(err.message);\n  }\n}\n```\n\n### Usage (in code, asynchronously)\n\n```javascript\nconst cleanSweep = require(\"clean-sweep\").promises;\nconst fileDirectory = \"\u003creplace file directory here\u003e\";\n\n(async function () {\n  try {\n    await cleanSweep.sweep(fileDirectory, {\n      /* specify if operation info should be printed to console, defaults to false */\n      verbose: true,\n      /* all files with size(in byte) below this thresh hold are deleted, defaults to 0 */\n      threshHold: 200\n    });\n  } catch (err) {\n    if (err.code == \"ENOENT\") {\n      console.error(\"Directory does not exist\");\n    } else {\n      console.error(err.message);\n    }\n  }\n})();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoahweasley%2Fclean-sweep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoahweasley%2Fclean-sweep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoahweasley%2Fclean-sweep/lists"}