@thi.ng/file-io 2.2.19 → 2.2.21
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 +1 -1
- package/delete.js +2 -2
- package/files.js +2 -2
- package/mask.js +1 -1
- package/package.json +7 -7
- package/watch.js +2 -2
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 212 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/delete.js
CHANGED
|
@@ -18,7 +18,7 @@ const deleteFileAsync = async (path, logger, dryRun = false) => {
|
|
|
18
18
|
return unlink(path);
|
|
19
19
|
};
|
|
20
20
|
const deleteFiles = (paths, logger, dryRun = false) => {
|
|
21
|
-
for (
|
|
21
|
+
for (const path of paths) {
|
|
22
22
|
try {
|
|
23
23
|
deleteFile(path, logger, dryRun);
|
|
24
24
|
} catch (e) {
|
|
@@ -31,7 +31,7 @@ const deleteFiles = (paths, logger, dryRun = false) => {
|
|
|
31
31
|
};
|
|
32
32
|
const deleteFilesAsync = async (paths, logger, dryRun = false) => {
|
|
33
33
|
const promises = [];
|
|
34
|
-
for (
|
|
34
|
+
for (const path of paths) {
|
|
35
35
|
promises.push(deleteFileAsync(path, logger, dryRun));
|
|
36
36
|
}
|
|
37
37
|
await Promise.allSettled(promises);
|
package/files.js
CHANGED
|
@@ -7,7 +7,7 @@ const files = (dir, match = "", maxDepth = Infinity, logger) => __files(dir, mat
|
|
|
7
7
|
function* __files(dir, match = "", logger, maxDepth = Infinity, depth = 0) {
|
|
8
8
|
if (depth >= maxDepth) return;
|
|
9
9
|
const pred = __ensurePred(match);
|
|
10
|
-
for (
|
|
10
|
+
for (const f of readdirSync(dir).sort()) {
|
|
11
11
|
const curr = dir + sep + f;
|
|
12
12
|
try {
|
|
13
13
|
if (isDirectory(curr)) {
|
|
@@ -24,7 +24,7 @@ const dirs = (dir, match = "", maxDepth = Infinity, logger) => __dirs(dir, match
|
|
|
24
24
|
function* __dirs(dir, match = "", logger, maxDepth = Infinity, depth = 0) {
|
|
25
25
|
if (depth >= maxDepth) return;
|
|
26
26
|
const pred = __ensurePred(match);
|
|
27
|
-
for (
|
|
27
|
+
for (const f of readdirSync(dir).sort()) {
|
|
28
28
|
const curr = dir + sep + f;
|
|
29
29
|
try {
|
|
30
30
|
if (isDirectory(curr)) {
|
package/mask.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/file-io",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.21",
|
|
4
4
|
"description": "Assorted file I/O utils (w/ logging support) for NodeJS/Bun",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@thi.ng/api": "^8.12.
|
|
43
|
-
"@thi.ng/checks": "^3.
|
|
44
|
-
"@thi.ng/hex": "^2.4.
|
|
45
|
-
"@thi.ng/logger": "^3.2.
|
|
46
|
-
"@thi.ng/random": "^4.1.
|
|
42
|
+
"@thi.ng/api": "^8.12.11",
|
|
43
|
+
"@thi.ng/checks": "^3.8.1",
|
|
44
|
+
"@thi.ng/hex": "^2.4.4",
|
|
45
|
+
"@thi.ng/logger": "^3.2.10",
|
|
46
|
+
"@thi.ng/random": "^4.1.36"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/node": "^24.10.1",
|
|
@@ -134,5 +134,5 @@
|
|
|
134
134
|
"status": "stable",
|
|
135
135
|
"year": 2022
|
|
136
136
|
},
|
|
137
|
-
"gitHead": "
|
|
137
|
+
"gitHead": "e7a21b9d2a188fa04d4c893d8531c40fbc0f4c06\n"
|
|
138
138
|
}
|
package/watch.js
CHANGED
|
@@ -33,7 +33,7 @@ let Watcher = class {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
addAll(paths) {
|
|
36
|
-
for (
|
|
36
|
+
for (const p of paths) {
|
|
37
37
|
isString(p) ? this.add(p) : this.add(...p);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -80,7 +80,7 @@ let Watcher = class {
|
|
|
80
80
|
return true;
|
|
81
81
|
}
|
|
82
82
|
removeAll(paths) {
|
|
83
|
-
for (
|
|
83
|
+
for (const p of paths) {
|
|
84
84
|
this.remove(p);
|
|
85
85
|
}
|
|
86
86
|
}
|