@thi.ng/file-io 2.1.2 → 2.1.3
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/CHANGELOG.md +1 -1
- package/README.md +2 -2
- package/file-chunks.d.ts +0 -1
- package/files.js +2 -2
- package/hash.d.ts +1 -3
- package/package.json +11 -11
- package/text.d.ts +0 -1
- package/watch.d.ts +8 -1
- package/write.d.ts +0 -1
package/CHANGELOG.md
CHANGED
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 193 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
|
>
|
|
@@ -54,7 +54,7 @@ For Node.js REPL:
|
|
|
54
54
|
const fio = await import("@thi.ng/file-io");
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 2.
|
|
57
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 2.05 KB
|
|
58
58
|
|
|
59
59
|
## Dependencies
|
|
60
60
|
|
package/file-chunks.d.ts
CHANGED
package/files.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readdirSync
|
|
1
|
+
import { readdirSync } from "node:fs";
|
|
2
2
|
import { sep } from "node:path";
|
|
3
3
|
import { isDirectory } from "./dir.js";
|
|
4
4
|
import { __ensurePred } from "./internal/ensure.js";
|
|
@@ -26,7 +26,7 @@ function* __dirs(dir, match = "", logger, maxDepth = Infinity, depth = 0) {
|
|
|
26
26
|
for (let f of readdirSync(dir).sort()) {
|
|
27
27
|
const curr = dir + sep + f;
|
|
28
28
|
try {
|
|
29
|
-
if (
|
|
29
|
+
if (isDirectory(curr)) {
|
|
30
30
|
if (pred(curr)) yield curr;
|
|
31
31
|
yield* __dirs(curr, match, logger, maxDepth, depth + 1);
|
|
32
32
|
}
|
package/hash.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import type { TypedArray } from "@thi.ng/api";
|
|
4
2
|
import type { ILogger } from "@thi.ng/logger";
|
|
5
3
|
import type { Readable } from "node:stream";
|
|
@@ -18,7 +16,7 @@ export declare const fileHash: (path: string, logger?: ILogger, algo?: HashAlgo)
|
|
|
18
16
|
* "sha256"). If `logger` is given, the hash will be logged too.
|
|
19
17
|
*
|
|
20
18
|
* @remarks
|
|
21
|
-
* Also see {@link fileHash} and {@link
|
|
19
|
+
* Also see {@link fileHash} and {@link bufferHash}.
|
|
22
20
|
*
|
|
23
21
|
* @param src
|
|
24
22
|
* @param logger
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/file-io",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "Assorted file I/O utils (with logging support) for NodeJS/Bun",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/thi-ng/umbrella.git"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://
|
|
13
|
+
"homepage": "https://thi.ng/file-io",
|
|
14
14
|
"funding": [
|
|
15
15
|
{
|
|
16
16
|
"type": "github",
|
|
@@ -36,17 +36,17 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.11.
|
|
40
|
-
"@thi.ng/checks": "^3.6.
|
|
41
|
-
"@thi.ng/hex": "^2.3.
|
|
42
|
-
"@thi.ng/logger": "^3.0.
|
|
43
|
-
"@thi.ng/random": "^3.8.
|
|
39
|
+
"@thi.ng/api": "^8.11.3",
|
|
40
|
+
"@thi.ng/checks": "^3.6.5",
|
|
41
|
+
"@thi.ng/hex": "^2.3.47",
|
|
42
|
+
"@thi.ng/logger": "^3.0.13",
|
|
43
|
+
"@thi.ng/random": "^3.8.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@microsoft/api-extractor": "^7.
|
|
47
|
-
"esbuild": "^0.21.
|
|
46
|
+
"@microsoft/api-extractor": "^7.47.0",
|
|
47
|
+
"esbuild": "^0.21.5",
|
|
48
48
|
"typedoc": "^0.25.13",
|
|
49
|
-
"typescript": "^5.
|
|
49
|
+
"typescript": "^5.5.2"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|
|
52
52
|
"async",
|
|
@@ -123,5 +123,5 @@
|
|
|
123
123
|
"status": "stable",
|
|
124
124
|
"year": 2022
|
|
125
125
|
},
|
|
126
|
-
"gitHead": "
|
|
126
|
+
"gitHead": "154c95cf9d6bab32174498ec3b5b5d87e42be7f9\n"
|
|
127
127
|
}
|
package/text.d.ts
CHANGED
package/watch.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { type Event, type IClear, type INotify, type IObjectOf, type Listener, type Predicate } from "@thi.ng/api";
|
|
3
2
|
import type { ILogger } from "@thi.ng/logger";
|
|
4
3
|
import { type FSWatcher } from "node:fs";
|
|
@@ -16,7 +15,15 @@ export interface WatcherOpts {
|
|
|
16
15
|
logger: ILogger;
|
|
17
16
|
}
|
|
18
17
|
export interface PathWatchOpts {
|
|
18
|
+
/**
|
|
19
|
+
* If enabled (default) and if the path refers to a directory, any file
|
|
20
|
+
* changes within that dir (or any subdir) will trigger an event.
|
|
21
|
+
*/
|
|
19
22
|
recursive: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* File extension filter. If given, events are only triggered for paths
|
|
25
|
+
* matching this filter.
|
|
26
|
+
*/
|
|
20
27
|
ext: string | RegExp | Predicate<string>;
|
|
21
28
|
}
|
|
22
29
|
export declare const EVENT_ADDED = "added";
|
package/write.d.ts
CHANGED