@thi.ng/file-io 0.3.1 → 0.3.2
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/delete.d.ts +1 -1
- package/files.d.ts +2 -2
- package/hash.d.ts +2 -2
- package/json.d.ts +2 -2
- package/package.json +10 -10
- package/temp.d.ts +2 -2
- package/text.d.ts +2 -2
- package/write.d.ts +1 -2
package/CHANGELOG.md
CHANGED
package/delete.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ import type { ILogger } from "@thi.ng/logger";
|
|
|
8
8
|
* @param logger
|
|
9
9
|
* @param dryRun
|
|
10
10
|
*/
|
|
11
|
-
export declare const deleteFile: (path: string, logger?: ILogger
|
|
11
|
+
export declare const deleteFile: (path: string, logger?: ILogger, dryRun?: boolean) => void;
|
|
12
12
|
//# sourceMappingURL=delete.d.ts.map
|
package/files.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type { ILogger } from "@thi.ng/logger";
|
|
|
15
15
|
* @param maxDepth
|
|
16
16
|
* @param logger
|
|
17
17
|
*/
|
|
18
|
-
export declare const files: (dir: string, match?: string | RegExp, maxDepth?: number, logger?: ILogger
|
|
18
|
+
export declare const files: (dir: string, match?: string | RegExp, maxDepth?: number, logger?: ILogger) => IterableIterator<string>;
|
|
19
19
|
/**
|
|
20
20
|
* Similar to {@link files}, however yields iterator of only matching
|
|
21
21
|
* sub-directories in given `dir`. Normal files are being ignored.
|
|
@@ -29,5 +29,5 @@ export declare const files: (dir: string, match?: string | RegExp, maxDepth?: nu
|
|
|
29
29
|
* @param maxDepth
|
|
30
30
|
* @param logger
|
|
31
31
|
*/
|
|
32
|
-
export declare const dirs: (dir: string, match?: string | RegExp, maxDepth?: number, logger?: ILogger
|
|
32
|
+
export declare const dirs: (dir: string, match?: string | RegExp, maxDepth?: number, logger?: ILogger) => IterableIterator<string>;
|
|
33
33
|
//# sourceMappingURL=files.d.ts.map
|
package/hash.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ILogger } from "@thi.ng/logger";
|
|
2
2
|
export declare type HashAlgo = "gost-mac" | "md4" | "md5" | "md_gost94" | "ripemd160" | "sha1" | "sha224" | "sha256" | "sha384" | "sha512" | "streebog256" | "streebog512" | "whirlpool";
|
|
3
|
-
export declare const fileHash: (path: string, logger?: ILogger
|
|
4
|
-
export declare const stringHash: (src: string, logger?: ILogger
|
|
3
|
+
export declare const fileHash: (path: string, logger?: ILogger, algo?: HashAlgo) => string;
|
|
4
|
+
export declare const stringHash: (src: string, logger?: ILogger, algo?: HashAlgo) => string;
|
|
5
5
|
//# sourceMappingURL=hash.d.ts.map
|
package/json.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Fn3, NumOrString } from "@thi.ng/api";
|
|
2
2
|
import type { ILogger } from "@thi.ng/logger";
|
|
3
|
-
export declare const readJSON: (path: string, logger?: ILogger
|
|
3
|
+
export declare const readJSON: (path: string, logger?: ILogger) => any;
|
|
4
4
|
/**
|
|
5
5
|
* Serializes `obj` to JSON and writes result to UTF-8 file `path`. See
|
|
6
6
|
* {@link writeText} for more details.
|
|
@@ -16,5 +16,5 @@ export declare const readJSON: (path: string, logger?: ILogger | undefined) => a
|
|
|
16
16
|
* @param logger
|
|
17
17
|
* @param dryRun
|
|
18
18
|
*/
|
|
19
|
-
export declare const writeJSON: (path: string, obj: any, replacer?: Fn3<any, string, any, any> | NumOrString[] | null | undefined, space?: NumOrString | undefined, logger?: ILogger
|
|
19
|
+
export declare const writeJSON: (path: string, obj: any, replacer?: Fn3<any, string, any, any> | NumOrString[] | null | undefined, space?: NumOrString | undefined, logger?: ILogger, dryRun?: boolean) => void;
|
|
20
20
|
//# sourceMappingURL=json.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/file-io",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Assorted file I/O utils (with logging support) for NodeJS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.3.
|
|
38
|
-
"@thi.ng/checks": "^3.
|
|
39
|
-
"@thi.ng/logger": "^1.1.
|
|
40
|
-
"@thi.ng/random": "^3.3.
|
|
37
|
+
"@thi.ng/api": "^8.3.7",
|
|
38
|
+
"@thi.ng/checks": "^3.2.0",
|
|
39
|
+
"@thi.ng/logger": "^1.1.7",
|
|
40
|
+
"@thi.ng/random": "^3.3.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@microsoft/api-extractor": "^7.
|
|
44
|
-
"@thi.ng/testament": "^0.2.
|
|
43
|
+
"@microsoft/api-extractor": "^7.25.0",
|
|
44
|
+
"@thi.ng/testament": "^0.2.8",
|
|
45
45
|
"rimraf": "^3.0.2",
|
|
46
46
|
"tools": "^0.0.1",
|
|
47
|
-
"typedoc": "^0.22.
|
|
48
|
-
"typescript": "^4.
|
|
47
|
+
"typedoc": "^0.22.17",
|
|
48
|
+
"typescript": "^4.7.3"
|
|
49
49
|
},
|
|
50
50
|
"keywords": [
|
|
51
51
|
"file",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"status": "stable",
|
|
109
109
|
"year": 2022
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "9e516d30a1a537e027a6b3d78bf9121bc5831d31\n"
|
|
112
112
|
}
|
package/temp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TypedArray } from "@thi.ng/api";
|
|
2
2
|
import type { ILogger } from "@thi.ng/logger";
|
|
3
|
-
export declare const createTempFile: (body: string | TypedArray, logger?: ILogger
|
|
4
|
-
export declare const tempFilePath: (name?: string
|
|
3
|
+
export declare const createTempFile: (body: string | TypedArray, logger?: ILogger, name?: string) => string;
|
|
4
|
+
export declare const tempFilePath: (name?: string) => string;
|
|
5
5
|
//# sourceMappingURL=temp.d.ts.map
|
package/text.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ILogger } from "@thi.ng/logger";
|
|
2
|
-
export declare const readText: (path: string, logger?: ILogger
|
|
2
|
+
export declare const readText: (path: string, logger?: ILogger) => string;
|
|
3
3
|
/**
|
|
4
4
|
* Writes `body` as UTF-8 file to given `path`. If `dryRun` is true (default:
|
|
5
5
|
* false), the file WON'T be written, however if a `logger` is provided then at
|
|
@@ -10,5 +10,5 @@ export declare const readText: (path: string, logger?: ILogger | undefined) => s
|
|
|
10
10
|
* @param logger
|
|
11
11
|
* @param dryRun
|
|
12
12
|
*/
|
|
13
|
-
export declare const writeText: (path: string, body: string | string[], logger?: ILogger
|
|
13
|
+
export declare const writeText: (path: string, body: string | string[], logger?: ILogger, dryRun?: boolean) => void;
|
|
14
14
|
//# sourceMappingURL=text.d.ts.map
|
package/write.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { TypedArray } from "@thi.ng/api";
|
|
3
2
|
import type { ILogger } from "@thi.ng/logger";
|
|
4
3
|
import { WriteFileOptions } from "fs";
|
|
@@ -13,5 +12,5 @@ import { WriteFileOptions } from "fs";
|
|
|
13
12
|
* @param logger
|
|
14
13
|
* @param dryRun
|
|
15
14
|
*/
|
|
16
|
-
export declare const writeFile: (path: string, body: string | TypedArray, opts?: WriteFileOptions
|
|
15
|
+
export declare const writeFile: (path: string, body: string | TypedArray, opts?: WriteFileOptions, logger?: ILogger, dryRun?: boolean) => void;
|
|
17
16
|
//# sourceMappingURL=write.d.ts.map
|