remove-glob 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -59,6 +59,9 @@ $ remove foo bar
59
59
  $ remove --glob \"dist/**/*.{js,map}\"
60
60
  ```
61
61
 
62
+ > [!NOTE]
63
+ > When using the `--glob` option, it will skips `.git/` and `node_modules/` directories by default.
64
+
62
65
  ### Usage
63
66
 
64
67
  ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAWrD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,GAAE,aAAkB,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,qBAoElF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAWrD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,GAAE,aAAkB,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,qBA0ElF"}
package/dist/index.js CHANGED
@@ -32,7 +32,13 @@ export function removeSync(opts = {}, callback) {
32
32
  }
33
33
  const requiresCwdChange = !!(paths.length && opts.cwd);
34
34
  if (!paths.length && opts.glob) {
35
- paths = globSync(opts.glob, { cwd: opts.cwd, dot: true, onlyFiles: false, absolute: true });
35
+ paths = globSync(opts.glob, {
36
+ cwd: opts.cwd,
37
+ dot: true,
38
+ onlyFiles: false,
39
+ absolute: true,
40
+ ignore: ['**/.git/**', '**/node_modules/**'],
41
+ });
36
42
  }
37
43
  opts.stat && console.time('Duration');
38
44
  opts.dryRun && console.log('=== dry-run ===');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remove-glob",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "A tiny utility to remove items or directories recursively, also supports glob",
5
5
  "bin": {
6
6
  "remove": "dist/cli.js"
package/src/index.ts CHANGED
@@ -43,7 +43,13 @@ export function removeSync(opts: RemoveOptions = {}, callback?: (e?: Error) => v
43
43
  }
44
44
  const requiresCwdChange = !!(paths.length && opts.cwd);
45
45
  if (!paths.length && opts.glob) {
46
- paths = globSync(opts.glob, { cwd: opts.cwd, dot: true, onlyFiles: false, absolute: true });
46
+ paths = globSync(opts.glob, {
47
+ cwd: opts.cwd,
48
+ dot: true,
49
+ onlyFiles: false,
50
+ absolute: true,
51
+ ignore: ['**/.git/**', '**/node_modules/**'],
52
+ });
47
53
  }
48
54
  opts.stat && console.time('Duration');
49
55
  opts.dryRun && console.log('=== dry-run ===');