@zenfs/core 0.0.1
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 +293 -0
- package/dist/ApiError.d.ts +86 -0
- package/dist/ApiError.js +135 -0
- package/dist/backends/AsyncMirror.d.ts +102 -0
- package/dist/backends/AsyncMirror.js +252 -0
- package/dist/backends/AsyncStore.d.ts +166 -0
- package/dist/backends/AsyncStore.js +620 -0
- package/dist/backends/FolderAdapter.d.ts +52 -0
- package/dist/backends/FolderAdapter.js +184 -0
- package/dist/backends/InMemory.d.ts +25 -0
- package/dist/backends/InMemory.js +46 -0
- package/dist/backends/Locked.d.ts +64 -0
- package/dist/backends/Locked.js +302 -0
- package/dist/backends/OverlayFS.d.ts +120 -0
- package/dist/backends/OverlayFS.js +749 -0
- package/dist/backends/SyncStore.d.ts +223 -0
- package/dist/backends/SyncStore.js +479 -0
- package/dist/backends/backend.d.ts +73 -0
- package/dist/backends/backend.js +14 -0
- package/dist/backends/index.d.ts +11 -0
- package/dist/backends/index.js +15 -0
- package/dist/browser.min.js +12 -0
- package/dist/browser.min.js.map +7 -0
- package/dist/cred.d.ts +14 -0
- package/dist/cred.js +15 -0
- package/dist/emulation/callbacks.d.ts +382 -0
- package/dist/emulation/callbacks.js +422 -0
- package/dist/emulation/constants.d.ts +101 -0
- package/dist/emulation/constants.js +110 -0
- package/dist/emulation/fs.d.ts +7 -0
- package/dist/emulation/fs.js +5 -0
- package/dist/emulation/index.d.ts +5 -0
- package/dist/emulation/index.js +7 -0
- package/dist/emulation/promises.d.ts +309 -0
- package/dist/emulation/promises.js +521 -0
- package/dist/emulation/shared.d.ts +62 -0
- package/dist/emulation/shared.js +192 -0
- package/dist/emulation/sync.d.ts +278 -0
- package/dist/emulation/sync.js +392 -0
- package/dist/file.d.ts +449 -0
- package/dist/file.js +576 -0
- package/dist/filesystem.d.ts +367 -0
- package/dist/filesystem.js +542 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.js +113 -0
- package/dist/inode.d.ts +51 -0
- package/dist/inode.js +112 -0
- package/dist/mutex.d.ts +12 -0
- package/dist/mutex.js +48 -0
- package/dist/stats.d.ts +98 -0
- package/dist/stats.js +226 -0
- package/dist/utils.d.ts +52 -0
- package/dist/utils.js +261 -0
- package/license.md +122 -0
- package/package.json +61 -0
package/dist/cred.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credentials used for FS ops.
|
|
3
|
+
* Similar to Linux's cred struct. See https://github.com/torvalds/linux/blob/master/include/linux/cred.h
|
|
4
|
+
*/
|
|
5
|
+
export declare class Cred {
|
|
6
|
+
uid: number;
|
|
7
|
+
gid: number;
|
|
8
|
+
suid: number;
|
|
9
|
+
sgid: number;
|
|
10
|
+
euid: number;
|
|
11
|
+
egid: number;
|
|
12
|
+
constructor(uid: number, gid: number, suid: number, sgid: number, euid: number, egid: number);
|
|
13
|
+
static Root: Cred;
|
|
14
|
+
}
|
package/dist/cred.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credentials used for FS ops.
|
|
3
|
+
* Similar to Linux's cred struct. See https://github.com/torvalds/linux/blob/master/include/linux/cred.h
|
|
4
|
+
*/
|
|
5
|
+
export class Cred {
|
|
6
|
+
constructor(uid, gid, suid, sgid, euid, egid) {
|
|
7
|
+
this.uid = uid;
|
|
8
|
+
this.gid = gid;
|
|
9
|
+
this.suid = suid;
|
|
10
|
+
this.sgid = sgid;
|
|
11
|
+
this.euid = euid;
|
|
12
|
+
this.egid = egid;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
Cred.Root = new Cred(0, 0, 0, 0, 0, 0);
|
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import type { FSWatcher, ReadStream, WriteStream, symlink as _symlink } from 'fs';
|
|
4
|
+
import { BFSCallback, BFSOneArgCallback, BFSThreeArgCallback, FileContents } from '../filesystem';
|
|
5
|
+
import { Stats } from '../stats';
|
|
6
|
+
/**
|
|
7
|
+
* Asynchronous rename. No arguments other than a possible exception are given
|
|
8
|
+
* to the completion callback.
|
|
9
|
+
* @param oldPath
|
|
10
|
+
* @param newPath
|
|
11
|
+
* @param callback
|
|
12
|
+
*/
|
|
13
|
+
export declare function rename(oldPath: string, newPath: string, cb?: BFSOneArgCallback): void;
|
|
14
|
+
/**
|
|
15
|
+
* Test whether or not the given path exists by checking with the file system.
|
|
16
|
+
* Then call the callback argument with either true or false.
|
|
17
|
+
* @example Sample invocation
|
|
18
|
+
* fs.exists('/etc/passwd', function (exists) {
|
|
19
|
+
* util.debug(exists ? "it's there" : "no passwd!");
|
|
20
|
+
* });
|
|
21
|
+
* @param path
|
|
22
|
+
* @param callback
|
|
23
|
+
*/
|
|
24
|
+
export declare function exists(path: string, cb?: (exists: boolean) => unknown): void;
|
|
25
|
+
/**
|
|
26
|
+
* Asynchronous `stat`.
|
|
27
|
+
* @param path
|
|
28
|
+
* @param callback
|
|
29
|
+
*/
|
|
30
|
+
export declare function stat(path: string, cb?: BFSCallback<Stats>): void;
|
|
31
|
+
/**
|
|
32
|
+
* Asynchronous `lstat`.
|
|
33
|
+
* `lstat()` is identical to `stat()`, except that if path is a symbolic link,
|
|
34
|
+
* then the link itself is stat-ed, not the file that it refers to.
|
|
35
|
+
* @param path
|
|
36
|
+
* @param callback
|
|
37
|
+
*/
|
|
38
|
+
export declare function lstat(path: string, cb?: BFSCallback<Stats>): void;
|
|
39
|
+
/**
|
|
40
|
+
* Asynchronous `truncate`.
|
|
41
|
+
* @param path
|
|
42
|
+
* @param len
|
|
43
|
+
* @param callback
|
|
44
|
+
*/
|
|
45
|
+
export declare function truncate(path: string, cb?: BFSOneArgCallback): void;
|
|
46
|
+
export declare function truncate(path: string, len: number, cb?: BFSOneArgCallback): void;
|
|
47
|
+
/**
|
|
48
|
+
* Asynchronous `unlink`.
|
|
49
|
+
* @param path
|
|
50
|
+
* @param callback
|
|
51
|
+
*/
|
|
52
|
+
export declare function unlink(path: string, cb?: BFSOneArgCallback): void;
|
|
53
|
+
/**
|
|
54
|
+
* Asynchronous file open.
|
|
55
|
+
* Exclusive mode ensures that path is newly created.
|
|
56
|
+
*
|
|
57
|
+
* `flags` can be:
|
|
58
|
+
*
|
|
59
|
+
* * `'r'` - Open file for reading. An exception occurs if the file does not exist.
|
|
60
|
+
* * `'r+'` - Open file for reading and writing. An exception occurs if the file does not exist.
|
|
61
|
+
* * `'rs'` - Open file for reading in synchronous mode. Instructs the filesystem to not cache writes.
|
|
62
|
+
* * `'rs+'` - Open file for reading and writing, and opens the file in synchronous mode.
|
|
63
|
+
* * `'w'` - Open file for writing. The file is created (if it does not exist) or truncated (if it exists).
|
|
64
|
+
* * `'wx'` - Like 'w' but opens the file in exclusive mode.
|
|
65
|
+
* * `'w+'` - Open file for reading and writing. The file is created (if it does not exist) or truncated (if it exists).
|
|
66
|
+
* * `'wx+'` - Like 'w+' but opens the file in exclusive mode.
|
|
67
|
+
* * `'a'` - Open file for appending. The file is created if it does not exist.
|
|
68
|
+
* * `'ax'` - Like 'a' but opens the file in exclusive mode.
|
|
69
|
+
* * `'a+'` - Open file for reading and appending. The file is created if it does not exist.
|
|
70
|
+
* * `'ax+'` - Like 'a+' but opens the file in exclusive mode.
|
|
71
|
+
*
|
|
72
|
+
* @see http://www.manpagez.com/man/2/open/
|
|
73
|
+
* @param path
|
|
74
|
+
* @param flags
|
|
75
|
+
* @param mode defaults to `0644`
|
|
76
|
+
* @param callback
|
|
77
|
+
*/
|
|
78
|
+
export declare function open(path: string, flag: string, cb?: BFSCallback<number>): void;
|
|
79
|
+
export declare function open(path: string, flag: string, mode: number | string, cb?: BFSCallback<number>): void;
|
|
80
|
+
/**
|
|
81
|
+
* Asynchronously reads the entire contents of a file.
|
|
82
|
+
* @example Usage example
|
|
83
|
+
* fs.readFile('/etc/passwd', function (err, data) {
|
|
84
|
+
* if (err) throw err;
|
|
85
|
+
* console.log(data);
|
|
86
|
+
* });
|
|
87
|
+
* @param filename
|
|
88
|
+
* @param options
|
|
89
|
+
* @option options [String] encoding The string encoding for the file contents. Defaults to `null`.
|
|
90
|
+
* @option options [String] flag Defaults to `'r'`.
|
|
91
|
+
* @param callback If no encoding is specified, then the raw buffer is returned.
|
|
92
|
+
*/
|
|
93
|
+
export declare function readFile(filename: string, cb: BFSCallback<Buffer>): void;
|
|
94
|
+
export declare function readFile(filename: string, options: {
|
|
95
|
+
flag?: string;
|
|
96
|
+
}, callback?: BFSCallback<Buffer>): void;
|
|
97
|
+
export declare function readFile(filename: string, options: {
|
|
98
|
+
encoding: string;
|
|
99
|
+
flag?: string;
|
|
100
|
+
}, callback?: BFSCallback<string>): void;
|
|
101
|
+
export declare function readFile(filename: string, encoding: string, cb: BFSCallback<string>): void;
|
|
102
|
+
/**
|
|
103
|
+
* Asynchronously writes data to a file, replacing the file if it already
|
|
104
|
+
* exists.
|
|
105
|
+
*
|
|
106
|
+
* The encoding option is ignored if data is a buffer.
|
|
107
|
+
*
|
|
108
|
+
* @example Usage example
|
|
109
|
+
* fs.writeFile('message.txt', 'Hello Node', function (err) {
|
|
110
|
+
* if (err) throw err;
|
|
111
|
+
* console.log('It\'s saved!');
|
|
112
|
+
* });
|
|
113
|
+
* @param filename
|
|
114
|
+
* @param data
|
|
115
|
+
* @param options
|
|
116
|
+
* @option options [String] encoding Defaults to `'utf8'`.
|
|
117
|
+
* @option options [Number] mode Defaults to `0644`.
|
|
118
|
+
* @option options [String] flag Defaults to `'w'`.
|
|
119
|
+
* @param callback
|
|
120
|
+
*/
|
|
121
|
+
export declare function writeFile(filename: string, data: FileContents, cb?: BFSOneArgCallback): void;
|
|
122
|
+
export declare function writeFile(filename: string, data: FileContents, encoding?: string, cb?: BFSOneArgCallback): void;
|
|
123
|
+
export declare function writeFile(filename: string, data: FileContents, options?: {
|
|
124
|
+
encoding?: string;
|
|
125
|
+
mode?: string | number;
|
|
126
|
+
flag?: string;
|
|
127
|
+
}, cb?: BFSOneArgCallback): void;
|
|
128
|
+
/**
|
|
129
|
+
* Asynchronously append data to a file, creating the file if it not yet
|
|
130
|
+
* exists.
|
|
131
|
+
*
|
|
132
|
+
* @example Usage example
|
|
133
|
+
* fs.appendFile('message.txt', 'data to append', function (err) {
|
|
134
|
+
* if (err) throw err;
|
|
135
|
+
* console.log('The "data to append" was appended to file!');
|
|
136
|
+
* });
|
|
137
|
+
* @param filename
|
|
138
|
+
* @param data
|
|
139
|
+
* @param options
|
|
140
|
+
* @option options [String] encoding Defaults to `'utf8'`.
|
|
141
|
+
* @option options [Number] mode Defaults to `0644`.
|
|
142
|
+
* @option options [String] flag Defaults to `'a'`.
|
|
143
|
+
* @param callback
|
|
144
|
+
*/
|
|
145
|
+
export declare function appendFile(filename: string, data: FileContents, cb?: BFSOneArgCallback): void;
|
|
146
|
+
export declare function appendFile(filename: string, data: FileContents, options?: {
|
|
147
|
+
encoding?: string;
|
|
148
|
+
mode?: number | string;
|
|
149
|
+
flag?: string;
|
|
150
|
+
}, cb?: BFSOneArgCallback): void;
|
|
151
|
+
export declare function appendFile(filename: string, data: FileContents, encoding?: string, cb?: BFSOneArgCallback): void;
|
|
152
|
+
/**
|
|
153
|
+
* Asynchronous `fstat`.
|
|
154
|
+
* `fstat()` is identical to `stat()`, except that the file to be stat-ed is
|
|
155
|
+
* specified by the file descriptor `fd`.
|
|
156
|
+
* @param fd
|
|
157
|
+
* @param callback
|
|
158
|
+
*/
|
|
159
|
+
export declare function fstat(fd: number, cb?: BFSCallback<Stats>): void;
|
|
160
|
+
/**
|
|
161
|
+
* Asynchronous close.
|
|
162
|
+
* @param fd
|
|
163
|
+
* @param callback
|
|
164
|
+
*/
|
|
165
|
+
export declare function close(fd: number, cb?: BFSOneArgCallback): void;
|
|
166
|
+
/**
|
|
167
|
+
* Asynchronous ftruncate.
|
|
168
|
+
* @param fd
|
|
169
|
+
* @param len
|
|
170
|
+
* @param callback
|
|
171
|
+
*/
|
|
172
|
+
export declare function ftruncate(fd: number, cb?: BFSOneArgCallback): void;
|
|
173
|
+
export declare function ftruncate(fd: number, len?: number, cb?: BFSOneArgCallback): void;
|
|
174
|
+
/**
|
|
175
|
+
* Asynchronous fsync.
|
|
176
|
+
* @param fd
|
|
177
|
+
* @param callback
|
|
178
|
+
*/
|
|
179
|
+
export declare function fsync(fd: number, cb?: BFSOneArgCallback): void;
|
|
180
|
+
/**
|
|
181
|
+
* Asynchronous fdatasync.
|
|
182
|
+
* @param fd
|
|
183
|
+
* @param callback
|
|
184
|
+
*/
|
|
185
|
+
export declare function fdatasync(fd: number, cb?: BFSOneArgCallback): void;
|
|
186
|
+
/**
|
|
187
|
+
* Write buffer to the file specified by `fd`.
|
|
188
|
+
* Note that it is unsafe to use fs.write multiple times on the same file
|
|
189
|
+
* without waiting for the callback.
|
|
190
|
+
* @param fd
|
|
191
|
+
* @param buffer Buffer containing the data to write to
|
|
192
|
+
* the file.
|
|
193
|
+
* @param offset Offset in the buffer to start reading data from.
|
|
194
|
+
* @param length The amount of bytes to write to the file.
|
|
195
|
+
* @param position Offset from the beginning of the file where this
|
|
196
|
+
* data should be written. If position is null, the data will be written at
|
|
197
|
+
* the current position.
|
|
198
|
+
* @param callback The number specifies the number of bytes written into the file.
|
|
199
|
+
*/
|
|
200
|
+
export declare function write(fd: number, buffer: Buffer, offset: number, length: number, cb?: BFSThreeArgCallback<number, Buffer>): void;
|
|
201
|
+
export declare function write(fd: number, buffer: Buffer, offset: number, length: number, position: number | null, cb?: BFSThreeArgCallback<number, Buffer>): void;
|
|
202
|
+
export declare function write(fd: number, data: FileContents, cb?: BFSThreeArgCallback<number, string>): void;
|
|
203
|
+
export declare function write(fd: number, data: FileContents, position: number | null, cb?: BFSThreeArgCallback<number, string>): void;
|
|
204
|
+
export declare function write(fd: number, data: FileContents, position: number | null, encoding: BufferEncoding, cb?: BFSThreeArgCallback<number, string>): void;
|
|
205
|
+
/**
|
|
206
|
+
* Read data from the file specified by `fd`.
|
|
207
|
+
* @param buffer The buffer that the data will be
|
|
208
|
+
* written to.
|
|
209
|
+
* @param offset The offset within the buffer where writing will
|
|
210
|
+
* start.
|
|
211
|
+
* @param length An integer specifying the number of bytes to read.
|
|
212
|
+
* @param position An integer specifying where to begin reading from
|
|
213
|
+
* in the file. If position is null, data will be read from the current file
|
|
214
|
+
* position.
|
|
215
|
+
* @param callback The number is the number of bytes read
|
|
216
|
+
*/
|
|
217
|
+
export declare function read(fd: number, buffer: Buffer, offset: number, length: number, position?: number, cb?: BFSThreeArgCallback<number, Buffer>): void;
|
|
218
|
+
/**
|
|
219
|
+
* Asynchronous `fchown`.
|
|
220
|
+
* @param fd
|
|
221
|
+
* @param uid
|
|
222
|
+
* @param gid
|
|
223
|
+
* @param callback
|
|
224
|
+
*/
|
|
225
|
+
export declare function fchown(fd: number, uid: number, gid: number, cb?: BFSOneArgCallback): void;
|
|
226
|
+
/**
|
|
227
|
+
* Asynchronous `fchmod`.
|
|
228
|
+
* @param fd
|
|
229
|
+
* @param mode
|
|
230
|
+
* @param callback
|
|
231
|
+
*/
|
|
232
|
+
export declare function fchmod(fd: number, mode: string | number, cb: BFSOneArgCallback): void;
|
|
233
|
+
/**
|
|
234
|
+
* Change the file timestamps of a file referenced by the supplied file
|
|
235
|
+
* descriptor.
|
|
236
|
+
* @param fd
|
|
237
|
+
* @param atime
|
|
238
|
+
* @param mtime
|
|
239
|
+
* @param callback
|
|
240
|
+
*/
|
|
241
|
+
export declare function futimes(fd: number, atime: number | Date, mtime: number | Date, cb?: BFSOneArgCallback): void;
|
|
242
|
+
/**
|
|
243
|
+
* Asynchronous `rmdir`.
|
|
244
|
+
* @param path
|
|
245
|
+
* @param callback
|
|
246
|
+
*/
|
|
247
|
+
export declare function rmdir(path: string, cb?: BFSOneArgCallback): void;
|
|
248
|
+
/**
|
|
249
|
+
* Asynchronous `mkdir`.
|
|
250
|
+
* @param path
|
|
251
|
+
* @param mode defaults to `0777`
|
|
252
|
+
* @param callback
|
|
253
|
+
*/
|
|
254
|
+
export declare function mkdir(path: string, mode?: any, cb?: BFSOneArgCallback): void;
|
|
255
|
+
/**
|
|
256
|
+
* Asynchronous `readdir`. Reads the contents of a directory.
|
|
257
|
+
* The callback gets two arguments `(err, files)` where `files` is an array of
|
|
258
|
+
* the names of the files in the directory excluding `'.'` and `'..'`.
|
|
259
|
+
* @param path
|
|
260
|
+
* @param callback
|
|
261
|
+
*/
|
|
262
|
+
export declare function readdir(path: string, cb?: BFSCallback<string[]>): void;
|
|
263
|
+
/**
|
|
264
|
+
* Asynchronous `link`.
|
|
265
|
+
* @param srcpath
|
|
266
|
+
* @param dstpath
|
|
267
|
+
* @param callback
|
|
268
|
+
*/
|
|
269
|
+
export declare function link(srcpath: string, dstpath: string, cb?: BFSOneArgCallback): void;
|
|
270
|
+
/**
|
|
271
|
+
* Asynchronous `symlink`.
|
|
272
|
+
* @param srcpath
|
|
273
|
+
* @param dstpath
|
|
274
|
+
* @param type can be either `'dir'` or `'file'` (default is `'file'`)
|
|
275
|
+
* @param callback
|
|
276
|
+
*/
|
|
277
|
+
export declare function symlink(srcpath: string, dstpath: string, cb?: BFSOneArgCallback): void;
|
|
278
|
+
export declare function symlink(srcpath: string, dstpath: string, type?: _symlink.Type, cb?: BFSOneArgCallback): void;
|
|
279
|
+
/**
|
|
280
|
+
* Asynchronous readlink.
|
|
281
|
+
* @param path
|
|
282
|
+
* @param callback
|
|
283
|
+
*/
|
|
284
|
+
export declare function readlink(path: string, cb?: BFSCallback<string>): void;
|
|
285
|
+
/**
|
|
286
|
+
* Asynchronous `chown`.
|
|
287
|
+
* @param path
|
|
288
|
+
* @param uid
|
|
289
|
+
* @param gid
|
|
290
|
+
* @param callback
|
|
291
|
+
*/
|
|
292
|
+
export declare function chown(path: string, uid: number, gid: number, cb?: BFSOneArgCallback): void;
|
|
293
|
+
/**
|
|
294
|
+
* Asynchronous `lchown`.
|
|
295
|
+
* @param path
|
|
296
|
+
* @param uid
|
|
297
|
+
* @param gid
|
|
298
|
+
* @param callback
|
|
299
|
+
*/
|
|
300
|
+
export declare function lchown(path: string, uid: number, gid: number, cb?: BFSOneArgCallback): void;
|
|
301
|
+
/**
|
|
302
|
+
* Asynchronous `chmod`.
|
|
303
|
+
* @param path
|
|
304
|
+
* @param mode
|
|
305
|
+
* @param callback
|
|
306
|
+
*/
|
|
307
|
+
export declare function chmod(path: string, mode: number | string, cb?: BFSOneArgCallback): void;
|
|
308
|
+
/**
|
|
309
|
+
* Asynchronous `lchmod`.
|
|
310
|
+
* @param path
|
|
311
|
+
* @param mode
|
|
312
|
+
* @param callback
|
|
313
|
+
*/
|
|
314
|
+
export declare function lchmod(path: string, mode: number | string, cb?: BFSOneArgCallback): void;
|
|
315
|
+
/**
|
|
316
|
+
* Change file timestamps of the file referenced by the supplied path.
|
|
317
|
+
* @param path
|
|
318
|
+
* @param atime
|
|
319
|
+
* @param mtime
|
|
320
|
+
* @param callback
|
|
321
|
+
*/
|
|
322
|
+
export declare function utimes(path: string, atime: number | Date, mtime: number | Date, cb?: BFSOneArgCallback): void;
|
|
323
|
+
/**
|
|
324
|
+
* Change file timestamps of the file referenced by the supplied path.
|
|
325
|
+
* @param path
|
|
326
|
+
* @param atime
|
|
327
|
+
* @param mtime
|
|
328
|
+
* @param callback
|
|
329
|
+
*/
|
|
330
|
+
export declare function lutimes(path: string, atime: number | Date, mtime: number | Date, cb?: BFSOneArgCallback): void;
|
|
331
|
+
/**
|
|
332
|
+
* Asynchronous `realpath`. The callback gets two arguments
|
|
333
|
+
* `(err, resolvedPath)`. May use `process.cwd` to resolve relative paths.
|
|
334
|
+
*
|
|
335
|
+
* @example Usage example
|
|
336
|
+
* let cache = {'/etc':'/private/etc'};
|
|
337
|
+
* fs.realpath('/etc/passwd', cache, function (err, resolvedPath) {
|
|
338
|
+
* if (err) throw err;
|
|
339
|
+
* console.log(resolvedPath);
|
|
340
|
+
* });
|
|
341
|
+
*
|
|
342
|
+
* @param path
|
|
343
|
+
* @param cache An object literal of mapped paths that can be used to
|
|
344
|
+
* force a specific path resolution or avoid additional `fs.stat` calls for
|
|
345
|
+
* known real paths.
|
|
346
|
+
* @param callback
|
|
347
|
+
*/
|
|
348
|
+
export declare function realpath(path: string, cb?: BFSCallback<string>): void;
|
|
349
|
+
export declare function realpath(path: string, cache: {
|
|
350
|
+
[path: string]: string;
|
|
351
|
+
}, cb: BFSCallback<string>): void;
|
|
352
|
+
/**
|
|
353
|
+
* Asynchronous `access`.
|
|
354
|
+
* @param path
|
|
355
|
+
* @param mode
|
|
356
|
+
* @param callback
|
|
357
|
+
*/
|
|
358
|
+
export declare function access(path: string, cb: BFSOneArgCallback): void;
|
|
359
|
+
export declare function access(path: string, mode: number, cb: BFSOneArgCallback): void;
|
|
360
|
+
export declare function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void;
|
|
361
|
+
export declare function watchFile(filename: string, options: {
|
|
362
|
+
persistent?: boolean;
|
|
363
|
+
interval?: number;
|
|
364
|
+
}, listener: (curr: Stats, prev: Stats) => void): void;
|
|
365
|
+
export declare function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void;
|
|
366
|
+
export declare function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher;
|
|
367
|
+
export declare function watch(filename: string, options: {
|
|
368
|
+
persistent?: boolean;
|
|
369
|
+
}, listener?: (event: string, filename: string) => any): FSWatcher;
|
|
370
|
+
export declare function createReadStream(path: string, options?: {
|
|
371
|
+
flags?: string;
|
|
372
|
+
encoding?: string;
|
|
373
|
+
fd?: number;
|
|
374
|
+
mode?: number;
|
|
375
|
+
autoClose?: boolean;
|
|
376
|
+
}): ReadStream;
|
|
377
|
+
export declare function createWriteStream(path: string, options?: {
|
|
378
|
+
flags?: string;
|
|
379
|
+
encoding?: string;
|
|
380
|
+
fd?: number;
|
|
381
|
+
mode?: number;
|
|
382
|
+
}): WriteStream;
|