@rush-fs/core 0.1.0-alpha.0
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/LICENSE +21 -0
- package/README.md +503 -0
- package/README.zh-CN.md +502 -0
- package/index.d.ts +251 -0
- package/index.js +786 -0
- package/package.json +126 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/* auto-generated by NAPI-RS */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export declare class Dirent {
|
|
4
|
+
readonly name: string
|
|
5
|
+
readonly parentPath: string
|
|
6
|
+
isFile(): boolean
|
|
7
|
+
isDirectory(): boolean
|
|
8
|
+
isSymbolicLink(): boolean
|
|
9
|
+
isBlockDevice(): boolean
|
|
10
|
+
isCharacterDevice(): boolean
|
|
11
|
+
isFIFO(): boolean
|
|
12
|
+
isSocket(): boolean
|
|
13
|
+
get path(): string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare class Stats {
|
|
17
|
+
readonly dev: number
|
|
18
|
+
readonly mode: number
|
|
19
|
+
readonly nlink: number
|
|
20
|
+
readonly uid: number
|
|
21
|
+
readonly gid: number
|
|
22
|
+
readonly rdev: number
|
|
23
|
+
readonly blksize: number
|
|
24
|
+
readonly ino: number
|
|
25
|
+
readonly size: number
|
|
26
|
+
readonly blocks: number
|
|
27
|
+
readonly atimeMs: number
|
|
28
|
+
readonly mtimeMs: number
|
|
29
|
+
readonly ctimeMs: number
|
|
30
|
+
readonly birthtimeMs: number
|
|
31
|
+
isFile(): boolean
|
|
32
|
+
isDirectory(): boolean
|
|
33
|
+
isSymbolicLink(): boolean
|
|
34
|
+
isBlockDevice(): boolean
|
|
35
|
+
isCharacterDevice(): boolean
|
|
36
|
+
isFIFO(): boolean
|
|
37
|
+
isSocket(): boolean
|
|
38
|
+
/** Returns atime as a Date object (Node.js compatible) */
|
|
39
|
+
get atime(): Date
|
|
40
|
+
/** Returns mtime as a Date object (Node.js compatible) */
|
|
41
|
+
get mtime(): Date
|
|
42
|
+
/** Returns ctime as a Date object (Node.js compatible) */
|
|
43
|
+
get ctime(): Date
|
|
44
|
+
/** Returns birthtime as a Date object (Node.js compatible) */
|
|
45
|
+
get birthtime(): Date
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export declare function access(path: string, mode?: number | undefined | null): Promise<unknown>
|
|
49
|
+
|
|
50
|
+
export declare function accessSync(path: string, mode?: number | undefined | null): void
|
|
51
|
+
|
|
52
|
+
export declare function appendFile(
|
|
53
|
+
path: string,
|
|
54
|
+
data: string | Buffer,
|
|
55
|
+
options?: WriteFileOptions | undefined | null,
|
|
56
|
+
): Promise<unknown>
|
|
57
|
+
|
|
58
|
+
export declare function appendFileSync(
|
|
59
|
+
path: string,
|
|
60
|
+
data: string | Buffer,
|
|
61
|
+
options?: WriteFileOptions | undefined | null,
|
|
62
|
+
): void
|
|
63
|
+
|
|
64
|
+
export declare function chmod(path: string, mode: number): Promise<unknown>
|
|
65
|
+
|
|
66
|
+
export declare function chmodSync(path: string, mode: number): void
|
|
67
|
+
|
|
68
|
+
export declare function chown(path: string, uid: number, gid: number): Promise<unknown>
|
|
69
|
+
|
|
70
|
+
export declare function chownSync(path: string, uid: number, gid: number): void
|
|
71
|
+
|
|
72
|
+
export declare function copyFile(src: string, dest: string, mode?: number | undefined | null): Promise<unknown>
|
|
73
|
+
|
|
74
|
+
export declare function copyFileSync(src: string, dest: string, mode?: number | undefined | null): void
|
|
75
|
+
|
|
76
|
+
export declare function cp(src: string, dest: string, options?: CpOptions | undefined | null): Promise<unknown>
|
|
77
|
+
|
|
78
|
+
export interface CpOptions {
|
|
79
|
+
recursive?: boolean
|
|
80
|
+
force?: boolean
|
|
81
|
+
errorOnExist?: boolean
|
|
82
|
+
preserveTimestamps?: boolean
|
|
83
|
+
dereference?: boolean
|
|
84
|
+
verbatimSymlinks?: boolean
|
|
85
|
+
/**
|
|
86
|
+
* Rush-FS extension: number of parallel threads for recursive copy.
|
|
87
|
+
* 0 or 1 means sequential; > 1 enables rayon parallel traversal.
|
|
88
|
+
*/
|
|
89
|
+
concurrency?: number
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export declare function cpSync(src: string, dest: string, options?: CpOptions | undefined | null): void
|
|
93
|
+
|
|
94
|
+
export declare function exists(path: string): Promise<unknown>
|
|
95
|
+
|
|
96
|
+
export declare function existsSync(path: string): boolean
|
|
97
|
+
|
|
98
|
+
export declare function glob(pattern: string, options?: GlobOptions | undefined | null): Promise<unknown>
|
|
99
|
+
|
|
100
|
+
export interface GlobOptions {
|
|
101
|
+
cwd?: string
|
|
102
|
+
withFileTypes?: boolean
|
|
103
|
+
exclude?: Array<string>
|
|
104
|
+
concurrency?: number
|
|
105
|
+
gitIgnore?: boolean
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export declare function globSync(
|
|
109
|
+
pattern: string,
|
|
110
|
+
options?: GlobOptions | undefined | null,
|
|
111
|
+
): Array<string> | Array<Dirent>
|
|
112
|
+
|
|
113
|
+
export declare function link(existingPath: string, newPath: string): Promise<unknown>
|
|
114
|
+
|
|
115
|
+
export declare function linkSync(existingPath: string, newPath: string): void
|
|
116
|
+
|
|
117
|
+
export declare function lstat(path: string): Promise<unknown>
|
|
118
|
+
|
|
119
|
+
export declare function lstatSync(path: string): Stats
|
|
120
|
+
|
|
121
|
+
export declare function mkdir(path: string, options?: MkdirOptions | undefined | null): Promise<unknown>
|
|
122
|
+
|
|
123
|
+
export interface MkdirOptions {
|
|
124
|
+
recursive?: boolean
|
|
125
|
+
mode?: number
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export declare function mkdirSync(path: string, options?: MkdirOptions | undefined | null): string | null
|
|
129
|
+
|
|
130
|
+
export declare function mkdtemp(prefix: string): Promise<unknown>
|
|
131
|
+
|
|
132
|
+
export declare function mkdtempSync(prefix: string): string
|
|
133
|
+
|
|
134
|
+
export declare function readdir(path: string, options?: ReaddirOptions | undefined | null): Promise<unknown>
|
|
135
|
+
|
|
136
|
+
/** * Reads the contents of a directory.
|
|
137
|
+
* @param {string | Buffer | URL} path
|
|
138
|
+
* @param {string | {
|
|
139
|
+
* encoding?: string;
|
|
140
|
+
* withFileTypes?: boolean;
|
|
141
|
+
* recursive?: boolean;
|
|
142
|
+
* }} [options]
|
|
143
|
+
* @param {(
|
|
144
|
+
* err?: Error,
|
|
145
|
+
* files?: string[] | Buffer[] | Dirent[]
|
|
146
|
+
* ) => any} callback
|
|
147
|
+
* @returns {void}
|
|
148
|
+
*/
|
|
149
|
+
export interface ReaddirOptions {
|
|
150
|
+
/**
|
|
151
|
+
* File name encoding. 'utf8' (default) returns strings.
|
|
152
|
+
* 'buffer' returns Buffer objects for each name.
|
|
153
|
+
* Other values are treated as 'utf8'.
|
|
154
|
+
*/
|
|
155
|
+
encoding?: string
|
|
156
|
+
skipHidden?: boolean
|
|
157
|
+
concurrency?: number
|
|
158
|
+
recursive?: boolean
|
|
159
|
+
withFileTypes?: boolean
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export declare function readdirSync(
|
|
163
|
+
path: string,
|
|
164
|
+
options?: ReaddirOptions | undefined | null,
|
|
165
|
+
): Array<string> | Array<Dirent>
|
|
166
|
+
|
|
167
|
+
export declare function readFile(path: string, options?: ReadFileOptions | undefined | null): Promise<unknown>
|
|
168
|
+
|
|
169
|
+
export interface ReadFileOptions {
|
|
170
|
+
encoding?: string
|
|
171
|
+
flag?: string
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export declare function readFileSync(path: string, options?: ReadFileOptions | undefined | null): string | Buffer
|
|
175
|
+
|
|
176
|
+
export declare function readlink(path: string): Promise<unknown>
|
|
177
|
+
|
|
178
|
+
export declare function readlinkSync(path: string): string
|
|
179
|
+
|
|
180
|
+
export declare function realpath(path: string): Promise<unknown>
|
|
181
|
+
|
|
182
|
+
export declare function realpathSync(path: string): string
|
|
183
|
+
|
|
184
|
+
export declare function rename(oldPath: string, newPath: string): Promise<unknown>
|
|
185
|
+
|
|
186
|
+
export declare function renameSync(oldPath: string, newPath: string): void
|
|
187
|
+
|
|
188
|
+
export declare function rm(path: string, options?: RmOptions | undefined | null): Promise<unknown>
|
|
189
|
+
|
|
190
|
+
export declare function rmdir(path: string): Promise<unknown>
|
|
191
|
+
|
|
192
|
+
export declare function rmdirSync(path: string): void
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Removes files and directories (modeled on the standard POSIX `rm` utility).
|
|
196
|
+
*
|
|
197
|
+
* - `force`: When true, silently ignore errors when path does not exist.
|
|
198
|
+
* - `recursive`: When true, remove directory and all its contents.
|
|
199
|
+
* - `maxRetries`: If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is
|
|
200
|
+
* encountered, Node.js retries the operation with a linear backoff of `retryDelay` ms longer on
|
|
201
|
+
* each try. This option represents the number of retries.
|
|
202
|
+
* - `retryDelay`: The amount of time in milliseconds to wait between retries (default 100ms).
|
|
203
|
+
* - `concurrency` (rush-fs extension): Number of parallel threads for recursive removal.
|
|
204
|
+
*/
|
|
205
|
+
export interface RmOptions {
|
|
206
|
+
force?: boolean
|
|
207
|
+
maxRetries?: number
|
|
208
|
+
recursive?: boolean
|
|
209
|
+
retryDelay?: number
|
|
210
|
+
concurrency?: number
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export declare function rmSync(path: string, options?: RmOptions | undefined | null): void
|
|
214
|
+
|
|
215
|
+
export declare function stat(path: string): Promise<unknown>
|
|
216
|
+
|
|
217
|
+
export declare function statSync(path: string): Stats
|
|
218
|
+
|
|
219
|
+
export declare function symlink(target: string, path: string, symlinkType?: string | undefined | null): Promise<unknown>
|
|
220
|
+
|
|
221
|
+
export declare function symlinkSync(target: string, path: string, symlinkType?: string | undefined | null): void
|
|
222
|
+
|
|
223
|
+
export declare function truncate(path: string, len?: number | undefined | null): Promise<unknown>
|
|
224
|
+
|
|
225
|
+
export declare function truncateSync(path: string, len?: number | undefined | null): void
|
|
226
|
+
|
|
227
|
+
export declare function unlink(path: string): Promise<unknown>
|
|
228
|
+
|
|
229
|
+
export declare function unlinkSync(path: string): void
|
|
230
|
+
|
|
231
|
+
export declare function utimes(path: string, atime: number, mtime: number): Promise<unknown>
|
|
232
|
+
|
|
233
|
+
export declare function utimesSync(path: string, atime: number, mtime: number): void
|
|
234
|
+
|
|
235
|
+
export declare function writeFile(
|
|
236
|
+
path: string,
|
|
237
|
+
data: string | Buffer,
|
|
238
|
+
options?: WriteFileOptions | undefined | null,
|
|
239
|
+
): Promise<unknown>
|
|
240
|
+
|
|
241
|
+
export interface WriteFileOptions {
|
|
242
|
+
encoding?: string
|
|
243
|
+
mode?: number
|
|
244
|
+
flag?: string
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export declare function writeFileSync(
|
|
248
|
+
path: string,
|
|
249
|
+
data: string | Buffer,
|
|
250
|
+
options?: WriteFileOptions | undefined | null,
|
|
251
|
+
): void
|