{"id":29905415,"url":"https://github.com/ghiscoding/remove-glob","last_synced_at":"2026-01-27T00:19:18.499Z","repository":{"id":302547924,"uuid":"1012288702","full_name":"ghiscoding/remove-glob","owner":"ghiscoding","description":"a small JS and CLI cross-platform util to remove files, directories","archived":false,"fork":false,"pushed_at":"2026-01-18T04:15:23.000Z","size":245,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-18T15:36:22.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghiscoding.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"ghiscoding","patreon":null,"open_collective":null,"ko_fi":"ghiscoding","tidelift":null,"custom":null}},"created_at":"2025-07-02T05:39:09.000Z","updated_at":"2026-01-18T04:15:27.000Z","dependencies_parsed_at":"2025-08-27T00:35:36.199Z","dependency_job_id":"b1f0664a-a67b-4ea9-9e85-dd2d73020f1d","html_url":"https://github.com/ghiscoding/remove-glob","commit_stats":null,"previous_names":["ghiscoding/remove-glob"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/ghiscoding/remove-glob","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghiscoding%2Fremove-glob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghiscoding%2Fremove-glob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghiscoding%2Fremove-glob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghiscoding%2Fremove-glob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghiscoding","download_url":"https://codeload.github.com/ghiscoding/remove-glob/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghiscoding%2Fremove-glob/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28792716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-08-01T19:13:47.171Z","updated_at":"2026-01-27T00:19:18.488Z","avatar_url":"https://github.com/ghiscoding.png","language":"TypeScript","funding_links":["https://github.com/sponsors/ghiscoding","https://ko-fi.com/ghiscoding"],"categories":[],"sub_categories":[],"readme":"[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)\n[![Vitest](https://img.shields.io/badge/tested%20with-vitest-fcc72b.svg?logo=vitest)](https://vitest.dev/)\n[![codecov](https://codecov.io/gh/ghiscoding/remove-glob/branch/main/graph/badge.svg)](https://codecov.io/gh/ghiscoding/remove-glob)\n[![npm](https://img.shields.io/npm/v/remove-glob.svg)](https://www.npmjs.com/package/remove-glob)\n[![npm](https://img.shields.io/npm/dy/remove-glob)](https://www.npmjs.com/package/remove-glob)\n[![npm bundle size](https://img.shields.io/bundlephobia/minzip/remove-glob?color=success\u0026label=gzip)](https://bundlephobia.com/result?p=remove-glob)\n\u003ca href=\"https://nodejs.org/en/about/previous-releases\"\u003e\u003cimg src=\"https://img.shields.io/node/v/remove-glob.svg\" alt=\"Node\" /\u003e\u003c/a\u003e\n\n## remove-glob\n\nA tiny cross-platform utility to remove items or directories recursively, it also accepts an optional glob pattern. There's also a CLI for easy, cross-platform usage using [cli-nano](https://www.npmjs.com/package/cli-nano) which is the only external dependency.\n\nInspired by [rimraf](https://www.npmjs.com/package/rimraf) and [premove](https://www.npmjs.com/package/premove) but also supports glob pattern to remove multiple files or directories.\n\n\u003e [!NOTE]\n\u003e This project now requires Node.JS \u003e= 22.17.0 so that we can use the native `fs.glob`, however if you can't update your Node.JS just yet, then just stick with `remove-glob: ^0.4.10` since that is the only change in v1.0.0\n\n### Install\n```sh\nnpm install remove-glob\n```\n\n### Command Line\n\nA `remove` binary is available, it takes an optional path argument (zero or multiple file/directory paths) to be removed **or** a `--glob` pattern instead of path(s).\n\n\u003e [!NOTE]\n\u003e The `paths` and `glob` arguments are both optionals, but you **must** provide at least 1 of them.\n\u003e However, please note that providing both of them simultaneously is not supported and will throw an error (choose the option that is best suited to your use case).\n\n\u003e [!NOTE]\n\u003e When using the `--glob` option, dotfiles and dot-directories (e.g. `.env`, `.gitignore`, `.config/`) are included by default. If you want to exclude them, you can adjust your glob pattern (e.g. use `**/[!.]*.js` or add an `!**/.*` pattern).\n\n```\nUsage:\n  remove [paths..] [options]  Remove all items recursively\n\nArguments:\n  paths           directory or file paths to remove                                         [string..]\n\nOptions:\n      --cwd       Directory to resolve from (default \".\")                                   [string]\n  -d, --dryRun    Show which files/dirs would be deleted but without actually removing them [boolean]\n  -g, --glob      Glob pattern(s) to find which files/dirs to remove                        [array]\n  -s, --stat      Show the stats of the items being removed                                 [boolean]\n  -V, --verbose   If true, it will log each file or directory being removed                 [boolean]\n  -h, --help      Show help                                                                 [boolean]\n  -v, --version   Show version number                                                       [boolean]\n```\n\nRemove files or directories.  Note: on Windows globs must be **double quoted**, everybody else can quote however they please.\n\n```sh\n# remove \"foo\" and \"bar\" via `npx`\n$ npx remove foo bar\n\n# or remove using glob pattern(s)\n$ npx remove --glob \\\"dist/**/*.js\\\"\n$ npx remove --glob=\\\"dist/**/*.js\\\" --glob=\\\"packages/*/tsconfig.tsbuildinfo\\\"\n\n# install globally, use whenever\n$ npm install remove-glob -g\n$ remove foo bar\n$ remove --glob \\\"dist/**/*.{js,map}\\\"\n```\n\n\u003e [!NOTE]\n\u003e When using the `--glob` option, it will skip `.git/` and `node_modules/` directories by default.\n\n### Usage\n\n```ts\nimport { resolve } from 'node:path';\nimport { removeSync } from 'remove-glob';\n\n// remove via paths\nremoveSync({ paths: './foobar' });\nremoveSync({ paths: ['./foo/file1.txt', './foo/file2.txt'] });\n\n// or remove via glob pattern\nremoveSync({ glob: 'foo/**/*.txt' });\n\n// Using `cwd` option\nconst dir = resolve('./foo/bar');\nawait removeSync({ paths: ['hello.txt'], cwd: dir });\n```\n\n### JavaScript API\n\n```js\nimport { removeSync } from 'remove-glob';\n\nremoveSync(opt, callback);\n```\n\nThe first argument is an object holding any of the options shown below. The last argument is an optional callback function that will be executed after all files were removed.\n\n```js\n{\n  cwd: string;              // directory to resolve your `filepath` from, defaults to `process.cwd()`\n  dryRun: boolean;          // show what would be copied, without actually copying anything\n  paths: string | string[]; // filepath(s) to remove – may be a file or a directory.\n  glob: string;             // glob pattern to find which files/directories to remove\n  stats: boolean;           // show some statistics after execution (time + file count)\n  verbose: boolean;         // print more information to console when executing the removal\n}\n```\n\n\u003e [!NOTE]\n\u003e The first argument is required and it **must** include either a `paths` or a `glob`, but it cannot include both options simultaneously.\n\n### Used by\n\nI use it in most of my own open source projects as a Dev Dependency (feel free to modify this list and add your project(s) as well)\n\n- [Lerna-Lite](https://github.com/lerna-lite/lerna-lite)\n- [SlickGrid](https://github.com/6pac/SlickGrid)\n- [Slickgrid-Universal](https://github.com/ghiscoding/slickgrid-universal)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghiscoding%2Fremove-glob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghiscoding%2Fremove-glob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghiscoding%2Fremove-glob/lists"}