@warlock.js/fs 4.1.6 → 4.1.8
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/cjs/index.cjs +11 -11
- package/esm/atomic.d.mts +1 -1
- package/esm/atomic.mjs +1 -1
- package/esm/copy.d.mts +1 -1
- package/esm/copy.mjs +1 -1
- package/esm/dirs.d.mts +1 -1
- package/esm/dirs.mjs +1 -1
- package/esm/exists.d.mts +1 -1
- package/esm/exists.mjs +1 -1
- package/esm/hash.d.mts +1 -1
- package/esm/hash.mjs +1 -1
- package/esm/list.d.mts +1 -1
- package/esm/list.mjs +1 -1
- package/esm/read.d.mts +1 -1
- package/esm/read.mjs +1 -1
- package/esm/remove.d.mts +1 -1
- package/esm/remove.mjs +1 -1
- package/esm/rename.d.mts +1 -1
- package/esm/rename.mjs +1 -1
- package/esm/stats.d.mts +1 -1
- package/esm/stats.mjs +1 -1
- package/esm/write.d.mts +1 -1
- package/esm/write.mjs +1 -1
- package/package.json +1 -1
package/cjs/index.cjs
CHANGED
|
@@ -32,7 +32,7 @@ let node_path = require("node:path");
|
|
|
32
32
|
node_path = __toESM(node_path, 1);
|
|
33
33
|
let node_fs = require("node:fs");
|
|
34
34
|
|
|
35
|
-
//#region
|
|
35
|
+
//#region ../@warlock.js/fs/src/atomic.ts
|
|
36
36
|
/**
|
|
37
37
|
* Write a file atomically.
|
|
38
38
|
*
|
|
@@ -66,7 +66,7 @@ async function atomicWriteJsonAsync(filePath, value) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
//#endregion
|
|
69
|
-
//#region
|
|
69
|
+
//#region ../@warlock.js/fs/src/copy.ts
|
|
70
70
|
/**
|
|
71
71
|
* Copy a single file. Creates the destination's parent directory if needed.
|
|
72
72
|
*/
|
|
@@ -89,7 +89,7 @@ function copyDirectory(source, destination) {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
//#endregion
|
|
92
|
-
//#region
|
|
92
|
+
//#region ../@warlock.js/fs/src/dirs.ts
|
|
93
93
|
/**
|
|
94
94
|
* Ensure a directory exists (recursively creating parents).
|
|
95
95
|
* Idempotent — no error if the directory already exists.
|
|
@@ -102,7 +102,7 @@ function ensureDirectory(path) {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
//#endregion
|
|
105
|
-
//#region
|
|
105
|
+
//#region ../@warlock.js/fs/src/exists.ts
|
|
106
106
|
/**
|
|
107
107
|
* Check whether a path exists, REGARDLESS of type — resolves `true` for both
|
|
108
108
|
* files and directories, `false` only when nothing is there (ENOENT).
|
|
@@ -183,7 +183,7 @@ function directoryExists(path) {
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
//#endregion
|
|
186
|
-
//#region
|
|
186
|
+
//#region ../@warlock.js/fs/src/hash.ts
|
|
187
187
|
/**
|
|
188
188
|
* Compute a hex digest of a file's contents. Uses streaming for large
|
|
189
189
|
* files so memory doesn't spike when hashing big assets.
|
|
@@ -229,7 +229,7 @@ async function hashFileSmallAsync(path, algorithm = "sha256") {
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
//#endregion
|
|
232
|
-
//#region
|
|
232
|
+
//#region ../@warlock.js/fs/src/list.ts
|
|
233
233
|
/**
|
|
234
234
|
* List immediate children of a directory (files + subdirs), returning
|
|
235
235
|
* full paths.
|
|
@@ -262,7 +262,7 @@ function listDirectories(directoryPath) {
|
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
//#endregion
|
|
265
|
-
//#region
|
|
265
|
+
//#region ../@warlock.js/fs/src/read.ts
|
|
266
266
|
/**
|
|
267
267
|
* Read a file as UTF-8 text.
|
|
268
268
|
*/
|
|
@@ -285,7 +285,7 @@ function getJsonFile(path) {
|
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
//#endregion
|
|
288
|
-
//#region
|
|
288
|
+
//#region ../@warlock.js/fs/src/remove.ts
|
|
289
289
|
/**
|
|
290
290
|
* Delete a single file. No error if the file doesn't exist.
|
|
291
291
|
*/
|
|
@@ -320,7 +320,7 @@ function removeDirectory(path) {
|
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
//#endregion
|
|
323
|
-
//#region
|
|
323
|
+
//#region ../@warlock.js/fs/src/rename.ts
|
|
324
324
|
/**
|
|
325
325
|
* Rename / move a file or directory.
|
|
326
326
|
*/
|
|
@@ -332,7 +332,7 @@ function renameFile(from, to) {
|
|
|
332
332
|
}
|
|
333
333
|
|
|
334
334
|
//#endregion
|
|
335
|
-
//#region
|
|
335
|
+
//#region ../@warlock.js/fs/src/stats.ts
|
|
336
336
|
/**
|
|
337
337
|
* Get last-modified time of a path. Returns a Date.
|
|
338
338
|
*
|
|
@@ -355,7 +355,7 @@ function stats(path) {
|
|
|
355
355
|
}
|
|
356
356
|
|
|
357
357
|
//#endregion
|
|
358
|
-
//#region
|
|
358
|
+
//#region ../@warlock.js/fs/src/write.ts
|
|
359
359
|
/**
|
|
360
360
|
* Write a UTF-8 string to disk, creating any missing parent directories.
|
|
361
361
|
*/
|
package/esm/atomic.d.mts
CHANGED
package/esm/atomic.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { randomBytes } from "node:crypto";
|
|
|
2
2
|
import { mkdir, rename, unlink, writeFile } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../@warlock.js/fs/src/atomic.ts
|
|
6
6
|
/**
|
|
7
7
|
* Write a file atomically.
|
|
8
8
|
*
|
package/esm/copy.d.mts
CHANGED
package/esm/copy.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { copyFile, cp, mkdir } from "node:fs/promises";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { copyFileSync, cpSync, mkdirSync } from "node:fs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../@warlock.js/fs/src/copy.ts
|
|
6
6
|
/**
|
|
7
7
|
* Copy a single file. Creates the destination's parent directory if needed.
|
|
8
8
|
*/
|
package/esm/dirs.d.mts
CHANGED
package/esm/dirs.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mkdir } from "node:fs/promises";
|
|
2
2
|
import { mkdirSync } from "node:fs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/fs/src/dirs.ts
|
|
5
5
|
/**
|
|
6
6
|
* Ensure a directory exists (recursively creating parents).
|
|
7
7
|
* Idempotent — no error if the directory already exists.
|
package/esm/exists.d.mts
CHANGED
package/esm/exists.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { access, stat } from "node:fs/promises";
|
|
2
2
|
import { accessSync, statSync } from "node:fs";
|
|
3
3
|
|
|
4
|
-
//#region
|
|
4
|
+
//#region ../@warlock.js/fs/src/exists.ts
|
|
5
5
|
/**
|
|
6
6
|
* Check whether a path exists, REGARDLESS of type — resolves `true` for both
|
|
7
7
|
* files and directories, `false` only when nothing is there (ENOENT).
|
package/esm/hash.d.mts
CHANGED
package/esm/hash.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import { createReadStream, readFileSync } from "node:fs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../@warlock.js/fs/src/hash.ts
|
|
6
6
|
/**
|
|
7
7
|
* Compute a hex digest of a file's contents. Uses streaming for large
|
|
8
8
|
* files so memory doesn't spike when hashing big assets.
|
package/esm/list.d.mts
CHANGED
package/esm/list.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { readdir, stat } from "node:fs/promises";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { readdirSync, statSync } from "node:fs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../@warlock.js/fs/src/list.ts
|
|
6
6
|
/**
|
|
7
7
|
* List immediate children of a directory (files + subdirs), returning
|
|
8
8
|
* full paths.
|
package/esm/read.d.mts
CHANGED
package/esm/read.mjs
CHANGED
package/esm/remove.d.mts
CHANGED
package/esm/remove.mjs
CHANGED
package/esm/rename.d.mts
CHANGED
package/esm/rename.mjs
CHANGED
package/esm/stats.d.mts
CHANGED
package/esm/stats.mjs
CHANGED
package/esm/write.d.mts
CHANGED
package/esm/write.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { mkdir, writeFile } from "node:fs/promises";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../@warlock.js/fs/src/write.ts
|
|
6
6
|
/**
|
|
7
7
|
* Write a UTF-8 string to disk, creating any missing parent directories.
|
|
8
8
|
*/
|