@zukhruf/fs 0.6.13 → 0.6.14
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 +40 -1
- package/dist/file-stamp.d.ts +21 -0
- package/dist/file-stamp.d.ts.map +1 -0
- package/dist/file-stamp.js +60 -0
- package/dist/file-stamp.js.map +1 -0
- package/dist/file-stamps.d.ts +17 -0
- package/dist/file-stamps.d.ts.map +1 -0
- package/dist/file-stamps.js +30 -0
- package/dist/file-stamps.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @zukhruf/fs
|
|
2
2
|
|
|
3
|
-
Helpers that write files,
|
|
3
|
+
Helpers that write files, a lock on a file that the kernel frees when its holder dies, and a stamp that tells that a file changed. A reader never sees a part of a write. `@zukhruf/mutex` uses them for its lock files, `@zukhruf/fencing` for its fencing counters, and `@zukhruf/election` for the claim and the epoch of each election. `@zukhruf/single-flight` keeps no lock files of its own: its election claims a `FileLock` through `@zukhruf/election`.
|
|
4
4
|
|
|
5
5
|
The words in these documents have one meaning each. See the glossary in [CONTEXT.md](./CONTEXT.md).
|
|
6
6
|
|
|
@@ -169,6 +169,45 @@ try {
|
|
|
169
169
|
|
|
170
170
|
`@zukhruf/mutex` and `@zukhruf/single-flight` give this same `NetworkDirectoryError` class. A catch with `instanceof` works for each of them.
|
|
171
171
|
|
|
172
|
+
## Tell that a file changed
|
|
173
|
+
|
|
174
|
+
A program that watches a file reads it again after each write. A read of the whole file on each check costs too much, and a file-change event can come late or not at all. Git has the same problem for each file in a working tree. Git compares the stat data of the file with the stat data that it kept: when they are equal, the file did not change. A `FileStamp` is that stat data.
|
|
175
|
+
|
|
176
|
+
```ts
|
|
177
|
+
import { FileStamp } from '@zukhruf/fs';
|
|
178
|
+
|
|
179
|
+
const before = await FileStamp.read('/var/lib/app/store.json');
|
|
180
|
+
// ... later
|
|
181
|
+
const now = await FileStamp.read('/var/lib/app/store.json');
|
|
182
|
+
if (!now.equals(before)) console.log('The store changed. Read it again.');
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
- A file stamp holds the device, the inode, the size, the time of the last write and the time of the last change of the file. Each time is to the nanosecond.
|
|
186
|
+
- A write changes the stamp. This is also true when the writer gives back the old write time, as `rsync -t` and `tar` do, because the kernel sets the time of the change. The writer cannot set that time.
|
|
187
|
+
- A new file at the path changes the stamp, also with the same size and write time. A program that replaces its file with a rename makes a new file.
|
|
188
|
+
- A missing file has a stamp of its own. Two missing stamps of one path are equal. When the file comes back, the stamp changes.
|
|
189
|
+
- A path through a file, for example `file/store`, is missing too (`ENOTDIR`).
|
|
190
|
+
- Each other error of `stat` reaches the caller, for example `EACCES` for a folder that the process may not search. A file that the process may not see is not a missing file.
|
|
191
|
+
- `modifiedAt` is the time of the last write. It is `undefined` for a missing file.
|
|
192
|
+
- `FileStamp.read(path)` reads the stamp. `FileStamp.readSync(path)` reads it and blocks.
|
|
193
|
+
- `toString()` gives the stamp as text, so that you can keep it.
|
|
194
|
+
|
|
195
|
+
`FileStamps` holds the stamps of several files that change together, for example a database and its journal, or the files of one store. A write of any file changes the whole. A missing file is a part of it.
|
|
196
|
+
|
|
197
|
+
```ts
|
|
198
|
+
import { FileStamps } from '@zukhruf/fs';
|
|
199
|
+
|
|
200
|
+
const stamps = await FileStamps.read([
|
|
201
|
+
'/var/lib/app/History',
|
|
202
|
+
'/var/lib/app/History-journal',
|
|
203
|
+
]);
|
|
204
|
+
console.log(stamps.modifiedAt); // the newest write of the files that are present
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
`modifiedAt` of `FileStamps` is the newest write of the files that are present. It is `undefined` when no file is present.
|
|
208
|
+
|
|
209
|
+
No package on npm does this job. [ADR 0004](./docs/adr/0004-a-file-stamp-is-the-stat-data-that-git-compares.md) tells why each candidate failed.
|
|
210
|
+
|
|
172
211
|
## Check the error code
|
|
173
212
|
|
|
174
213
|
`isErrno(error, code)` tells if `error` is a Node.js system error with that error code.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the file system says about the file at a path: its device, inode,
|
|
3
|
+
* size, and the times of its last write and its last change, to the
|
|
4
|
+
* nanosecond. A write of the file changes its stamp, also when the writer
|
|
5
|
+
* gives back the old write time, because the kernel sets the change time. A
|
|
6
|
+
* new file at the path changes it too. A missing file has a stamp of its own.
|
|
7
|
+
* Git compares the same stat data to know that a file is unchanged without a
|
|
8
|
+
* read of its content.
|
|
9
|
+
*/
|
|
10
|
+
export declare class FileStamp {
|
|
11
|
+
#private;
|
|
12
|
+
readonly path: string;
|
|
13
|
+
/** When the file was last written; undefined when no file is at the path. */
|
|
14
|
+
readonly modifiedAt: Date | undefined;
|
|
15
|
+
private constructor();
|
|
16
|
+
static read(path: string): Promise<FileStamp>;
|
|
17
|
+
static readSync(path: string): FileStamp;
|
|
18
|
+
equals(other: FileStamp): boolean;
|
|
19
|
+
toString(): string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=file-stamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-stamp.d.ts","sourceRoot":"","sources":["../src/file-stamp.ts"],"names":[],"mappings":"AAWA;;;;;;;;GAQG;AACH,qBAAa,SAAS;;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,EAAE,IAAI,GAAG,SAAS,CAAC;IAGtC,OAAO;WAYM,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IASnD,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS;IASxC,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO;IAIjC,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { statSync } from 'node:fs';
|
|
2
|
+
import { stat } from 'node:fs/promises';
|
|
3
|
+
import { isErrno } from "./errno.js";
|
|
4
|
+
// Absence: no file at the path, or a part of the path that is a file and not
|
|
5
|
+
// a folder. A folder that the process may not search is not absence: stat
|
|
6
|
+
// fails with EACCES, and that error reaches the caller.
|
|
7
|
+
const absent = (error) => isErrno(error, 'ENOENT') || isErrno(error, 'ENOTDIR');
|
|
8
|
+
/**
|
|
9
|
+
* What the file system says about the file at a path: its device, inode,
|
|
10
|
+
* size, and the times of its last write and its last change, to the
|
|
11
|
+
* nanosecond. A write of the file changes its stamp, also when the writer
|
|
12
|
+
* gives back the old write time, because the kernel sets the change time. A
|
|
13
|
+
* new file at the path changes it too. A missing file has a stamp of its own.
|
|
14
|
+
* Git compares the same stat data to know that a file is unchanged without a
|
|
15
|
+
* read of its content.
|
|
16
|
+
*/
|
|
17
|
+
export class FileStamp {
|
|
18
|
+
path;
|
|
19
|
+
/** When the file was last written; undefined when no file is at the path. */
|
|
20
|
+
modifiedAt;
|
|
21
|
+
#value;
|
|
22
|
+
constructor(path, stats) {
|
|
23
|
+
this.path = path;
|
|
24
|
+
this.modifiedAt =
|
|
25
|
+
stats === undefined
|
|
26
|
+
? undefined
|
|
27
|
+
: new Date(Number(stats.mtimeNs / 1000000n));
|
|
28
|
+
this.#value =
|
|
29
|
+
stats === undefined
|
|
30
|
+
? 'missing'
|
|
31
|
+
: `${stats.dev}:${stats.ino}:${stats.size}:${stats.mtimeNs}:${stats.ctimeNs}`;
|
|
32
|
+
}
|
|
33
|
+
static async read(path) {
|
|
34
|
+
try {
|
|
35
|
+
return new FileStamp(path, await stat(path, { bigint: true }));
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
if (absent(error))
|
|
39
|
+
return new FileStamp(path, undefined);
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
static readSync(path) {
|
|
44
|
+
try {
|
|
45
|
+
return new FileStamp(path, statSync(path, { bigint: true }));
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
if (absent(error))
|
|
49
|
+
return new FileStamp(path, undefined);
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
equals(other) {
|
|
54
|
+
return this.path === other.path && this.#value === other.#value;
|
|
55
|
+
}
|
|
56
|
+
toString() {
|
|
57
|
+
return this.#value;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=file-stamp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-stamp.js","sourceRoot":"","sources":["../src/file-stamp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,QAAQ,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,6EAA6E;AAC7E,0EAA0E;AAC1E,wDAAwD;AACxD,MAAM,MAAM,GAAG,CAAC,KAAc,EAAE,EAAE,CAChC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAExD;;;;;;;;GAQG;AACH,MAAM,OAAO,SAAS;IACX,IAAI,CAAS;IACtB,6EAA6E;IACpE,UAAU,CAAmB;IAC7B,MAAM,CAAS;IAExB,YAAoB,IAAY,EAAE,KAA8B;QAC9D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU;YACb,KAAK,KAAK,SAAS;gBACjB,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,QAAU,CAAC,CAAC,CAAC;QACnD,IAAI,CAAC,MAAM;YACT,KAAK,KAAK,SAAS;gBACjB,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;IACpF,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAY;QAC5B,IAAI,CAAC;YACH,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACjE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,MAAM,CAAC,KAAK,CAAC;gBAAE,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YACzD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,IAAY;QAC1B,IAAI,CAAC;YACH,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC/D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,MAAM,CAAC,KAAK,CAAC;gBAAE,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YACzD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED,MAAM,CAAC,KAAgB;QACrB,OAAO,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,CAAC;IAClE,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FileStamp } from './file-stamp.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The stamps of several files that change together, such as a database and
|
|
4
|
+
* its journal, or the files of one store. A write of any of them changes the
|
|
5
|
+
* whole. A missing file is a part of it, so its return is a change too.
|
|
6
|
+
*/
|
|
7
|
+
export declare class FileStamps {
|
|
8
|
+
readonly stamps: readonly FileStamp[];
|
|
9
|
+
private constructor();
|
|
10
|
+
static read(paths: readonly string[]): Promise<FileStamps>;
|
|
11
|
+
static readSync(paths: readonly string[]): FileStamps;
|
|
12
|
+
/** When the newest of the files was written; undefined when none is present. */
|
|
13
|
+
get modifiedAt(): Date | undefined;
|
|
14
|
+
equals(other: FileStamps): boolean;
|
|
15
|
+
toString(): string;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=file-stamps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-stamps.d.ts","sourceRoot":"","sources":["../src/file-stamps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;GAIG;AACH,qBAAa,UAAU;IACrB,QAAQ,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;IAEtC,OAAO;WAIM,IAAI,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;IAIhE,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU;IAIrD,gFAAgF;IAChF,IAAI,UAAU,IAAI,IAAI,GAAG,SAAS,CAKjC;IAED,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO;IAIlC,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FileStamp } from "./file-stamp.js";
|
|
2
|
+
/**
|
|
3
|
+
* The stamps of several files that change together, such as a database and
|
|
4
|
+
* its journal, or the files of one store. A write of any of them changes the
|
|
5
|
+
* whole. A missing file is a part of it, so its return is a change too.
|
|
6
|
+
*/
|
|
7
|
+
export class FileStamps {
|
|
8
|
+
stamps;
|
|
9
|
+
constructor(stamps) {
|
|
10
|
+
this.stamps = stamps;
|
|
11
|
+
}
|
|
12
|
+
static async read(paths) {
|
|
13
|
+
return new FileStamps(await Promise.all(paths.map(FileStamp.read)));
|
|
14
|
+
}
|
|
15
|
+
static readSync(paths) {
|
|
16
|
+
return new FileStamps(paths.map(FileStamp.readSync));
|
|
17
|
+
}
|
|
18
|
+
/** When the newest of the files was written; undefined when none is present. */
|
|
19
|
+
get modifiedAt() {
|
|
20
|
+
const times = this.stamps.flatMap(({ modifiedAt }) => modifiedAt === undefined ? [] : [modifiedAt.getTime()]);
|
|
21
|
+
return times.length === 0 ? undefined : new Date(Math.max(...times));
|
|
22
|
+
}
|
|
23
|
+
equals(other) {
|
|
24
|
+
return this.toString() === other.toString();
|
|
25
|
+
}
|
|
26
|
+
toString() {
|
|
27
|
+
return this.stamps.map((stamp) => `${stamp.path}=${stamp}`).join('\n');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=file-stamps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-stamps.js","sourceRoot":"","sources":["../src/file-stamps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;;;GAIG;AACH,MAAM,OAAO,UAAU;IACZ,MAAM,CAAuB;IAEtC,YAAoB,MAA4B;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAwB;QACxC,OAAO,IAAI,UAAU,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,KAAwB;QACtC,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvD,CAAC;IAED,gFAAgF;IAChF,IAAI,UAAU;QACZ,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CACnD,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CACvD,CAAC;QACF,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IACvE,CAAC;IAED,MAAM,CAAC,KAAiB;QACtB,OAAO,IAAI,CAAC,QAAQ,EAAE,KAAK,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC9C,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzE,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export { atomicWrite } from './atomic-write.ts';
|
|
|
2
2
|
export { createExclusive } from './create-exclusive.ts';
|
|
3
3
|
export { draftSuffixLength } from './draft.ts';
|
|
4
4
|
export { durableWrite } from './durable-write.ts';
|
|
5
|
+
export { FileStamp } from './file-stamp.ts';
|
|
6
|
+
export { FileStamps } from './file-stamps.ts';
|
|
5
7
|
export { isErrno } from './errno.ts';
|
|
6
8
|
export { FileLock } from './file-lock.ts';
|
|
7
9
|
export { assertLocalDirectory } from './local-directory.ts';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,8 @@ export { atomicWrite } from "./atomic-write.js";
|
|
|
2
2
|
export { createExclusive } from "./create-exclusive.js";
|
|
3
3
|
export { draftSuffixLength } from "./draft.js";
|
|
4
4
|
export { durableWrite } from "./durable-write.js";
|
|
5
|
+
export { FileStamp } from "./file-stamp.js";
|
|
6
|
+
export { FileStamps } from "./file-stamps.js";
|
|
5
7
|
export { isErrno } from "./errno.js";
|
|
6
8
|
export { FileLock } from "./file-lock.js";
|
|
7
9
|
export { assertLocalDirectory } from "./local-directory.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zukhruf/fs",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"description": "File writes
|
|
3
|
+
"version": "0.6.14",
|
|
4
|
+
"description": "File writes a reader never sees half done, a file lock the kernel frees when its holder dies, and a file stamp that tells that a file changed, as git does. Retries Windows' short refusals. Names a file after any key.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -25,7 +25,10 @@
|
|
|
25
25
|
"flock",
|
|
26
26
|
"sqlite",
|
|
27
27
|
"windows",
|
|
28
|
-
"eperm"
|
|
28
|
+
"eperm",
|
|
29
|
+
"stat",
|
|
30
|
+
"file-stamp",
|
|
31
|
+
"change-detection"
|
|
29
32
|
],
|
|
30
33
|
"type": "module",
|
|
31
34
|
"exports": {
|
|
@@ -47,6 +50,6 @@
|
|
|
47
50
|
"access": "public"
|
|
48
51
|
},
|
|
49
52
|
"devDependencies": {
|
|
50
|
-
"@zukhruf/testing": "^0.6.
|
|
53
|
+
"@zukhruf/testing": "^0.6.14"
|
|
51
54
|
}
|
|
52
55
|
}
|