poof 3.0.0 → 3.1.0
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 +24 -5
- package/dist/cli.mjs +551 -590
- package/dist/index.mjs +86 -26
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<h2 align="center">
|
|
2
|
-
<img width="240" src=".github/logo.
|
|
2
|
+
<img width="240" src=".github/logo.webp">
|
|
3
3
|
<br><br>
|
|
4
4
|
<a href="https://npm.im/poof"><img src="https://badgen.net/npm/v/poof"></a> <a href="https://npm.im/poof"><img src="https://badgen.net/npm/dm/poof"></a> <a href="https://packagephobia.now.sh/result?p=poof"><img src="https://packagephobia.now.sh/badge?p=poof"></a>
|
|
5
5
|
</h2>
|
|
@@ -34,16 +34,16 @@ npm install -g poof
|
|
|
34
34
|
|
|
35
35
|
```sh
|
|
36
36
|
# Delete files or directories
|
|
37
|
-
poof node_modules dist
|
|
37
|
+
$ poof node_modules dist
|
|
38
38
|
|
|
39
39
|
# Use glob patterns
|
|
40
|
-
poof "*.log" "temp-*"
|
|
40
|
+
$ poof "*.log" "temp-*"
|
|
41
41
|
|
|
42
42
|
# Recursive match with ** (searches all subdirectories)
|
|
43
|
-
poof "**/node_modules" "**/dist"
|
|
43
|
+
$ poof "**/node_modules" "**/dist"
|
|
44
44
|
|
|
45
45
|
# Verbose output
|
|
46
|
-
poof --verbose ./large-directory
|
|
46
|
+
$ poof --verbose ./large-directory
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
### Options
|
|
@@ -52,6 +52,7 @@ poof --verbose ./large-directory
|
|
|
52
52
|
| ------------- | ----- | ---------------------------------------------- |
|
|
53
53
|
| `--dry` | `-d` | Preview files without deleting |
|
|
54
54
|
| `--verbose` | `-v` | Log each file as it's deleted |
|
|
55
|
+
| `--ignore` | `-i` | Glob pattern to exclude from deletion |
|
|
55
56
|
| `--dangerous` | | Allow deleting paths outside current directory |
|
|
56
57
|
| `--version` | | Show version |
|
|
57
58
|
| `--help` | | Show help |
|
|
@@ -105,6 +106,18 @@ $ poof "**/*.log"
|
|
|
105
106
|
$ poof "**/dist" "**/coverage" "**/*.tmp"
|
|
106
107
|
```
|
|
107
108
|
|
|
109
|
+
### Excluding paths
|
|
110
|
+
|
|
111
|
+
Use `--ignore` to exclude paths from deletion:
|
|
112
|
+
|
|
113
|
+
```sh
|
|
114
|
+
# Delete all dist folders except those in node_modules
|
|
115
|
+
$ poof "**/dist" --ignore "**/node_modules/**"
|
|
116
|
+
|
|
117
|
+
# Multiple ignore patterns
|
|
118
|
+
$ poof "**/*.log" -i "**/important/**" -i "**/backup/**"
|
|
119
|
+
```
|
|
120
|
+
|
|
108
121
|
### Dotfiles (hidden files)
|
|
109
122
|
|
|
110
123
|
By default, glob wildcards (`*`, `**`) don't match dotfiles (files starting with `.`). This helps avoid accidentally deleting `.git`, `.env`, or other hidden files.
|
|
@@ -215,6 +228,7 @@ type Options = {
|
|
|
215
228
|
cwd?: string
|
|
216
229
|
dry?: boolean
|
|
217
230
|
dangerous?: boolean
|
|
231
|
+
ignore?: string[]
|
|
218
232
|
}
|
|
219
233
|
|
|
220
234
|
type Failure = {
|
|
@@ -246,3 +260,8 @@ Node.js >= 20.19.6
|
|
|
246
260
|
## License
|
|
247
261
|
|
|
248
262
|
MIT
|
|
263
|
+
|
|
264
|
+
<br>
|
|
265
|
+
<p align="center">
|
|
266
|
+
<img width="830" src=".github/banner.webp">
|
|
267
|
+
</p>
|