@utoo/web 1.0.7 → 1.2.0-rc.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/esm/aa0ad15d2a587c43406f.wasm +0 -0
- package/esm/internalProject.d.ts +1 -0
- package/esm/internalProject.js +10 -85
- package/esm/loaderWorker.js +2 -0
- package/esm/loaderWorker.js.LICENSE.txt +44 -0
- package/esm/loaderWorkerPool.d.ts +3 -0
- package/esm/loaderWorkerPool.js +125 -0
- package/esm/project.d.ts +1 -0
- package/esm/project.js +2 -0
- package/esm/sabcom.d.ts +31 -0
- package/esm/sabcom.js +71 -0
- package/esm/type.d.ts +1 -0
- package/esm/utoo/index.d.ts +71 -46
- package/esm/utoo/index.js +260 -168
- package/esm/utoo/index_bg.wasm +0 -0
- package/esm/webpackLoaders/loaders/less-loader/index.js +7 -12
- package/esm/webpackLoaders/loaders/less-loader/options.json +1 -3
- package/esm/webpackLoaders/loaders/less-loader/utils.js +14 -34
- package/esm/webpackLoaders/worker/cjs.js +253 -58
- package/esm/webpackLoaders/worker/index.d.ts +2 -2
- package/esm/webpackLoaders/worker/index.js +36 -26
- package/esm/webpackLoaders/worker/polyfills/fastGlobPolyfill.d.ts +2 -0
- package/esm/webpackLoaders/worker/polyfills/fastGlobPolyfill.js +48 -0
- package/esm/webpackLoaders/worker/polyfills/fsPolyfill.d.ts +124 -0
- package/esm/webpackLoaders/worker/polyfills/fsPolyfill.js +316 -0
- package/esm/webpackLoaders/worker/polyfills/fsPromisesPolyfill.d.ts +9 -0
- package/esm/webpackLoaders/worker/polyfills/fsPromisesPolyfill.js +9 -0
- package/esm/webpackLoaders/worker/polyfills/nodePolyFills.d.ts +94 -0
- package/esm/webpackLoaders/worker/polyfills/nodePolyFills.js +229 -0
- package/esm/webpackLoaders/worker/polyfills/workerThreadsPolyfill.d.ts +7 -0
- package/esm/webpackLoaders/worker/polyfills/workerThreadsPolyfill.js +16 -0
- package/esm/webpackLoaders/worker/type.d.ts +1 -1
- package/package.json +11 -11
- package/esm/webpackLoaders/worker/nodePolyFills.d.ts +0 -14
- package/esm/webpackLoaders/worker/nodePolyFills.js +0 -24
- package/esm/webpackLoaders/workerContent.d.ts +0 -2
- package/esm/webpackLoaders/workerContent.js +0 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Buffer } from "buffer";
|
|
2
|
+
export declare function readFile(path: string, options: any, cb: Function): void;
|
|
3
|
+
export declare function readFileSync(path: string, options: any): string | Buffer<any>;
|
|
4
|
+
export declare function readdirSync(path: string, options?: any): any;
|
|
5
|
+
export declare function readdir(path: string, options: any, cb: Function): void;
|
|
6
|
+
export declare function writeFileSync(path: string, data: string | Uint8Array, options?: any): void;
|
|
7
|
+
export declare function writeFile(path: string, data: string | Uint8Array, options: any, cb: Function): void;
|
|
8
|
+
export declare function mkdirSync(path: string, options?: any): void;
|
|
9
|
+
export declare function mkdir(path: string, options: any, cb: Function): void;
|
|
10
|
+
export declare function rmSync(path: string, options?: any): void;
|
|
11
|
+
export declare function rm(path: string, options: any, cb: Function): void;
|
|
12
|
+
export declare function rmdirSync(path: string, options?: any): void;
|
|
13
|
+
export declare function rmdir(path: string, options: any, cb: Function): void;
|
|
14
|
+
export declare function copyFileSync(src: string, dst: string): void;
|
|
15
|
+
export declare function copyFile(src: string, dst: string, cb: Function): void;
|
|
16
|
+
export declare function statSync(p: string): {
|
|
17
|
+
isDirectory: () => any;
|
|
18
|
+
isFile: () => any;
|
|
19
|
+
isSymbolicLink: () => any;
|
|
20
|
+
size: number;
|
|
21
|
+
mtime: Date;
|
|
22
|
+
};
|
|
23
|
+
export declare function lstatSync(p: string): {
|
|
24
|
+
isDirectory: () => any;
|
|
25
|
+
isFile: () => any;
|
|
26
|
+
isSymbolicLink: () => any;
|
|
27
|
+
size: number;
|
|
28
|
+
mtime: Date;
|
|
29
|
+
};
|
|
30
|
+
export declare function stat(path: string, cb: Function): void;
|
|
31
|
+
export declare function lstat(path: string, cb: Function): void;
|
|
32
|
+
export declare function realpathSync(p: string): string;
|
|
33
|
+
export declare function realpath(p: string, cb: Function): void;
|
|
34
|
+
export declare function accessSync(path: string, mode?: number): void;
|
|
35
|
+
export declare function access(path: string, mode: number | Function, cb?: Function): void;
|
|
36
|
+
export declare function existsSync(path: string): boolean;
|
|
37
|
+
export declare const promises: {
|
|
38
|
+
readFile: (path: string, options?: any) => Promise<string | Buffer<any>>;
|
|
39
|
+
writeFile: (path: string, data: string | Uint8Array, options?: any) => Promise<void>;
|
|
40
|
+
readdir: (path: string, options?: any) => Promise<any>;
|
|
41
|
+
mkdir: (path: string, options?: any) => Promise<void>;
|
|
42
|
+
rm: (path: string, options?: any) => Promise<void>;
|
|
43
|
+
rmdir: (path: string, options?: any) => Promise<void>;
|
|
44
|
+
copyFile: (src: string, dst: string) => Promise<void>;
|
|
45
|
+
stat: (p: string) => Promise<{
|
|
46
|
+
isDirectory: () => any;
|
|
47
|
+
isFile: () => any;
|
|
48
|
+
isSymbolicLink: () => any;
|
|
49
|
+
size: number;
|
|
50
|
+
mtime: Date;
|
|
51
|
+
}>;
|
|
52
|
+
lstat: (p: string) => Promise<{
|
|
53
|
+
isDirectory: () => any;
|
|
54
|
+
isFile: () => any;
|
|
55
|
+
isSymbolicLink: () => any;
|
|
56
|
+
size: number;
|
|
57
|
+
mtime: Date;
|
|
58
|
+
}>;
|
|
59
|
+
realpath: (p: string) => Promise<string>;
|
|
60
|
+
access: (path: string, mode?: number) => Promise<void>;
|
|
61
|
+
};
|
|
62
|
+
export declare const constants: {
|
|
63
|
+
F_OK: number;
|
|
64
|
+
R_OK: number;
|
|
65
|
+
W_OK: number;
|
|
66
|
+
X_OK: number;
|
|
67
|
+
};
|
|
68
|
+
declare const _default: {
|
|
69
|
+
readFile: typeof readFile;
|
|
70
|
+
readFileSync: typeof readFileSync;
|
|
71
|
+
readdir: typeof readdir;
|
|
72
|
+
readdirSync: typeof readdirSync;
|
|
73
|
+
writeFile: typeof writeFile;
|
|
74
|
+
writeFileSync: typeof writeFileSync;
|
|
75
|
+
mkdir: typeof mkdir;
|
|
76
|
+
mkdirSync: typeof mkdirSync;
|
|
77
|
+
rm: typeof rm;
|
|
78
|
+
rmSync: typeof rmSync;
|
|
79
|
+
rmdir: typeof rmdir;
|
|
80
|
+
rmdirSync: typeof rmdirSync;
|
|
81
|
+
copyFile: typeof copyFile;
|
|
82
|
+
copyFileSync: typeof copyFileSync;
|
|
83
|
+
stat: typeof stat;
|
|
84
|
+
statSync: typeof statSync;
|
|
85
|
+
lstat: typeof lstat;
|
|
86
|
+
lstatSync: typeof lstatSync;
|
|
87
|
+
realpath: typeof realpath;
|
|
88
|
+
realpathSync: typeof realpathSync;
|
|
89
|
+
access: typeof access;
|
|
90
|
+
accessSync: typeof accessSync;
|
|
91
|
+
existsSync: typeof existsSync;
|
|
92
|
+
promises: {
|
|
93
|
+
readFile: (path: string, options?: any) => Promise<string | Buffer<any>>;
|
|
94
|
+
writeFile: (path: string, data: string | Uint8Array, options?: any) => Promise<void>;
|
|
95
|
+
readdir: (path: string, options?: any) => Promise<any>;
|
|
96
|
+
mkdir: (path: string, options?: any) => Promise<void>;
|
|
97
|
+
rm: (path: string, options?: any) => Promise<void>;
|
|
98
|
+
rmdir: (path: string, options?: any) => Promise<void>;
|
|
99
|
+
copyFile: (src: string, dst: string) => Promise<void>;
|
|
100
|
+
stat: (p: string) => Promise<{
|
|
101
|
+
isDirectory: () => any;
|
|
102
|
+
isFile: () => any;
|
|
103
|
+
isSymbolicLink: () => any;
|
|
104
|
+
size: number;
|
|
105
|
+
mtime: Date;
|
|
106
|
+
}>;
|
|
107
|
+
lstat: (p: string) => Promise<{
|
|
108
|
+
isDirectory: () => any;
|
|
109
|
+
isFile: () => any;
|
|
110
|
+
isSymbolicLink: () => any;
|
|
111
|
+
size: number;
|
|
112
|
+
mtime: Date;
|
|
113
|
+
}>;
|
|
114
|
+
realpath: (p: string) => Promise<string>;
|
|
115
|
+
access: (path: string, mode?: number) => Promise<void>;
|
|
116
|
+
};
|
|
117
|
+
constants: {
|
|
118
|
+
F_OK: number;
|
|
119
|
+
R_OK: number;
|
|
120
|
+
W_OK: number;
|
|
121
|
+
X_OK: number;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
export default _default;
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { Buffer } from "buffer";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { SAB_OP_COPY_FILE, SAB_OP_MKDIR, SAB_OP_READ_DIR, SAB_OP_READ_FILE, SAB_OP_RM, SAB_OP_RMDIR, SAB_OP_WRITE_FILE, } from "../../../sabcom";
|
|
4
|
+
function resolvePath(p) {
|
|
5
|
+
var _a, _b, _c;
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
const cwd = ((_b = (_a = self.process) === null || _a === void 0 ? void 0 : _a.cwd) === null || _b === void 0 ? void 0 : _b.call(_a)) || ((_c = self.workerData) === null || _c === void 0 ? void 0 : _c.cwd) || "/";
|
|
8
|
+
if (cwd === "/") {
|
|
9
|
+
if (p.startsWith("/")) {
|
|
10
|
+
return p.slice(1);
|
|
11
|
+
}
|
|
12
|
+
return p;
|
|
13
|
+
}
|
|
14
|
+
if (p.startsWith(cwd)) {
|
|
15
|
+
// Check if it's an exact match or followed by separator
|
|
16
|
+
if (p.length === cwd.length) {
|
|
17
|
+
return ".";
|
|
18
|
+
}
|
|
19
|
+
if (p[cwd.length] === path.sep || p[cwd.length] === "/") {
|
|
20
|
+
let relative = p.slice(cwd.length);
|
|
21
|
+
if (relative.startsWith("/"))
|
|
22
|
+
relative = relative.slice(1);
|
|
23
|
+
return relative || ".";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return p;
|
|
27
|
+
}
|
|
28
|
+
function getSabClient() {
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
const client = self.workerData.sabClient;
|
|
31
|
+
if (!client) {
|
|
32
|
+
throw new Error("Sync fs not supported (no sabClient)");
|
|
33
|
+
}
|
|
34
|
+
return client;
|
|
35
|
+
}
|
|
36
|
+
export function readFile(path, options, cb) {
|
|
37
|
+
if (typeof options === "function") {
|
|
38
|
+
cb = options;
|
|
39
|
+
options = {};
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
const data = readFileSync(path, options);
|
|
43
|
+
cb(null, data);
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
cb(e);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export function readFileSync(path, options) {
|
|
50
|
+
const client = getSabClient();
|
|
51
|
+
const result = client.call(SAB_OP_READ_FILE, resolvePath(path));
|
|
52
|
+
if (options === "utf8" ||
|
|
53
|
+
options === "utf-8" ||
|
|
54
|
+
(options && (options.encoding === "utf8" || options.encoding === "utf-8"))) {
|
|
55
|
+
return new TextDecoder().decode(result);
|
|
56
|
+
}
|
|
57
|
+
return Buffer.from(result);
|
|
58
|
+
}
|
|
59
|
+
export function readdirSync(path, options) {
|
|
60
|
+
const client = getSabClient();
|
|
61
|
+
const result = client.call(SAB_OP_READ_DIR, resolvePath(path));
|
|
62
|
+
const json = new TextDecoder().decode(result);
|
|
63
|
+
const entries = JSON.parse(json);
|
|
64
|
+
if (options === null || options === void 0 ? void 0 : options.withFileTypes) {
|
|
65
|
+
return entries.map((e) => ({
|
|
66
|
+
name: e.name,
|
|
67
|
+
isFile: () => e.type === "file",
|
|
68
|
+
isDirectory: () => e.type === "directory",
|
|
69
|
+
isSymbolicLink: () => false,
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
return entries.map((e) => e.name);
|
|
73
|
+
}
|
|
74
|
+
export function readdir(path, options, cb) {
|
|
75
|
+
if (typeof options === "function") {
|
|
76
|
+
cb = options;
|
|
77
|
+
options = {};
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
const files = readdirSync(path, options);
|
|
81
|
+
cb(null, files);
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
cb(e);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
export function writeFileSync(path, data, options) {
|
|
88
|
+
const client = getSabClient();
|
|
89
|
+
// TODO: handle binary data properly
|
|
90
|
+
const content = typeof data === "string" ? data : new TextDecoder().decode(data);
|
|
91
|
+
const payload = JSON.stringify({ path: resolvePath(path), data: content });
|
|
92
|
+
client.call(SAB_OP_WRITE_FILE, payload);
|
|
93
|
+
}
|
|
94
|
+
export function writeFile(path, data, options, cb) {
|
|
95
|
+
if (typeof options === "function") {
|
|
96
|
+
cb = options;
|
|
97
|
+
options = {};
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
writeFileSync(path, data, options);
|
|
101
|
+
cb(null);
|
|
102
|
+
}
|
|
103
|
+
catch (e) {
|
|
104
|
+
cb(e);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
export function mkdirSync(path, options) {
|
|
108
|
+
const client = getSabClient();
|
|
109
|
+
const recursive = (options === null || options === void 0 ? void 0 : options.recursive) || false;
|
|
110
|
+
const payload = JSON.stringify({ path: resolvePath(path), recursive });
|
|
111
|
+
client.call(SAB_OP_MKDIR, payload);
|
|
112
|
+
}
|
|
113
|
+
export function mkdir(path, options, cb) {
|
|
114
|
+
if (typeof options === "function") {
|
|
115
|
+
cb = options;
|
|
116
|
+
options = {};
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
mkdirSync(path, options);
|
|
120
|
+
cb(null);
|
|
121
|
+
}
|
|
122
|
+
catch (e) {
|
|
123
|
+
cb(e);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
export function rmSync(path, options) {
|
|
127
|
+
const client = getSabClient();
|
|
128
|
+
const recursive = (options === null || options === void 0 ? void 0 : options.recursive) || false;
|
|
129
|
+
const payload = JSON.stringify({ path: resolvePath(path), recursive });
|
|
130
|
+
client.call(SAB_OP_RM, payload);
|
|
131
|
+
}
|
|
132
|
+
export function rm(path, options, cb) {
|
|
133
|
+
if (typeof options === "function") {
|
|
134
|
+
cb = options;
|
|
135
|
+
options = {};
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
rmSync(path, options);
|
|
139
|
+
cb(null);
|
|
140
|
+
}
|
|
141
|
+
catch (e) {
|
|
142
|
+
cb(e);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
export function rmdirSync(path, options) {
|
|
146
|
+
const client = getSabClient();
|
|
147
|
+
const recursive = (options === null || options === void 0 ? void 0 : options.recursive) || false;
|
|
148
|
+
const payload = JSON.stringify({ path: resolvePath(path), recursive });
|
|
149
|
+
client.call(SAB_OP_RMDIR, payload);
|
|
150
|
+
}
|
|
151
|
+
export function rmdir(path, options, cb) {
|
|
152
|
+
if (typeof options === "function") {
|
|
153
|
+
cb = options;
|
|
154
|
+
options = {};
|
|
155
|
+
}
|
|
156
|
+
try {
|
|
157
|
+
rmdirSync(path, options);
|
|
158
|
+
cb(null);
|
|
159
|
+
}
|
|
160
|
+
catch (e) {
|
|
161
|
+
cb(e);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
export function copyFileSync(src, dst) {
|
|
165
|
+
const client = getSabClient();
|
|
166
|
+
const payload = JSON.stringify({
|
|
167
|
+
src: resolvePath(src),
|
|
168
|
+
dst: resolvePath(dst),
|
|
169
|
+
});
|
|
170
|
+
client.call(SAB_OP_COPY_FILE, payload);
|
|
171
|
+
}
|
|
172
|
+
export function copyFile(src, dst, cb) {
|
|
173
|
+
try {
|
|
174
|
+
copyFileSync(src, dst);
|
|
175
|
+
cb(null);
|
|
176
|
+
}
|
|
177
|
+
catch (e) {
|
|
178
|
+
cb(e);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
export function statSync(p) {
|
|
182
|
+
const parent = path.dirname(p);
|
|
183
|
+
const name = path.basename(p);
|
|
184
|
+
// Root check
|
|
185
|
+
if (p === "/" || p === ".") {
|
|
186
|
+
return {
|
|
187
|
+
isDirectory: () => true,
|
|
188
|
+
isFile: () => false,
|
|
189
|
+
isSymbolicLink: () => false,
|
|
190
|
+
size: 0,
|
|
191
|
+
mtime: new Date(),
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
try {
|
|
195
|
+
const entries = readdirSync(parent, { withFileTypes: true });
|
|
196
|
+
const entry = entries.find((e) => e.name === name);
|
|
197
|
+
if (!entry) {
|
|
198
|
+
throw new Error(`ENOENT: no such file or directory, stat '${p}'`);
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
isDirectory: () => entry.isDirectory(),
|
|
202
|
+
isFile: () => entry.isFile(),
|
|
203
|
+
isSymbolicLink: () => entry.isSymbolicLink(),
|
|
204
|
+
size: 0,
|
|
205
|
+
mtime: new Date(),
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
catch (e) {
|
|
209
|
+
throw e;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
export function lstatSync(p) {
|
|
213
|
+
return statSync(p);
|
|
214
|
+
}
|
|
215
|
+
export function stat(path, cb) {
|
|
216
|
+
try {
|
|
217
|
+
const stats = statSync(path);
|
|
218
|
+
cb(null, stats);
|
|
219
|
+
}
|
|
220
|
+
catch (e) {
|
|
221
|
+
cb(e);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
export function lstat(path, cb) {
|
|
225
|
+
try {
|
|
226
|
+
const stats = lstatSync(path);
|
|
227
|
+
cb(null, stats);
|
|
228
|
+
}
|
|
229
|
+
catch (e) {
|
|
230
|
+
cb(e);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
export function realpathSync(p) {
|
|
234
|
+
return p;
|
|
235
|
+
}
|
|
236
|
+
export function realpath(p, cb) {
|
|
237
|
+
cb(null, p);
|
|
238
|
+
}
|
|
239
|
+
export function accessSync(path, mode) {
|
|
240
|
+
try {
|
|
241
|
+
statSync(path);
|
|
242
|
+
}
|
|
243
|
+
catch (e) {
|
|
244
|
+
throw e;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
export function access(path, mode, cb) {
|
|
248
|
+
if (typeof mode === "function") {
|
|
249
|
+
cb = mode;
|
|
250
|
+
mode = 0;
|
|
251
|
+
}
|
|
252
|
+
try {
|
|
253
|
+
accessSync(path, mode);
|
|
254
|
+
if (cb)
|
|
255
|
+
cb(null);
|
|
256
|
+
}
|
|
257
|
+
catch (e) {
|
|
258
|
+
if (cb)
|
|
259
|
+
cb(e);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
export function existsSync(path) {
|
|
263
|
+
try {
|
|
264
|
+
statSync(path);
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
catch (e) {
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
export const promises = {
|
|
272
|
+
readFile: async (path, options) => readFileSync(path, options),
|
|
273
|
+
writeFile: async (path, data, options) => writeFileSync(path, data, options),
|
|
274
|
+
readdir: async (path, options) => readdirSync(path, options),
|
|
275
|
+
mkdir: async (path, options) => mkdirSync(path, options),
|
|
276
|
+
rm: async (path, options) => rmSync(path, options),
|
|
277
|
+
rmdir: async (path, options) => rmdirSync(path, options),
|
|
278
|
+
copyFile: async (src, dst) => copyFileSync(src, dst),
|
|
279
|
+
stat: async (p) => statSync(p),
|
|
280
|
+
lstat: async (p) => lstatSync(p),
|
|
281
|
+
realpath: async (p) => realpathSync(p),
|
|
282
|
+
access: async (path, mode) => accessSync(path, mode),
|
|
283
|
+
};
|
|
284
|
+
export const constants = {
|
|
285
|
+
F_OK: 0,
|
|
286
|
+
R_OK: 4,
|
|
287
|
+
W_OK: 2,
|
|
288
|
+
X_OK: 1,
|
|
289
|
+
};
|
|
290
|
+
export default {
|
|
291
|
+
readFile,
|
|
292
|
+
readFileSync,
|
|
293
|
+
readdir,
|
|
294
|
+
readdirSync,
|
|
295
|
+
writeFile,
|
|
296
|
+
writeFileSync,
|
|
297
|
+
mkdir,
|
|
298
|
+
mkdirSync,
|
|
299
|
+
rm,
|
|
300
|
+
rmSync,
|
|
301
|
+
rmdir,
|
|
302
|
+
rmdirSync,
|
|
303
|
+
copyFile,
|
|
304
|
+
copyFileSync,
|
|
305
|
+
stat,
|
|
306
|
+
statSync,
|
|
307
|
+
lstat,
|
|
308
|
+
lstatSync,
|
|
309
|
+
realpath,
|
|
310
|
+
realpathSync,
|
|
311
|
+
access,
|
|
312
|
+
accessSync,
|
|
313
|
+
existsSync,
|
|
314
|
+
promises,
|
|
315
|
+
constants,
|
|
316
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { promises } from "./fsPolyfill";
|
|
2
|
+
export declare const readFile: (path: string, options?: any) => Promise<string | Buffer<any>>;
|
|
3
|
+
export declare const writeFile: (path: string, data: string | Uint8Array, options?: any) => Promise<void>;
|
|
4
|
+
export declare const readdir: (path: string, options?: any) => Promise<any>;
|
|
5
|
+
export declare const mkdir: (path: string, options?: any) => Promise<void>;
|
|
6
|
+
export declare const rm: (path: string, options?: any) => Promise<void>;
|
|
7
|
+
export declare const rmdir: (path: string, options?: any) => Promise<void>;
|
|
8
|
+
export declare const copyFile: (src: string, dst: string) => Promise<void>;
|
|
9
|
+
export default promises;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { promises } from "./fsPolyfill";
|
|
2
|
+
export const readFile = promises.readFile;
|
|
3
|
+
export const writeFile = promises.writeFile;
|
|
4
|
+
export const readdir = promises.readdir;
|
|
5
|
+
export const mkdir = promises.mkdir;
|
|
6
|
+
export const rm = promises.rm;
|
|
7
|
+
export const rmdir = promises.rmdir;
|
|
8
|
+
export const copyFile = promises.copyFile;
|
|
9
|
+
export default promises;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as fs from "./fsPolyfill";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
readonly assert: any;
|
|
4
|
+
readonly "node:assert": any;
|
|
5
|
+
buffer: any;
|
|
6
|
+
"node:buffer": any;
|
|
7
|
+
readonly child_process: any;
|
|
8
|
+
readonly "node:child_process": any;
|
|
9
|
+
readonly cluster: any;
|
|
10
|
+
readonly "node:cluster": any;
|
|
11
|
+
readonly console: any;
|
|
12
|
+
readonly "node:console": any;
|
|
13
|
+
readonly constants: any;
|
|
14
|
+
readonly "node:constants": any;
|
|
15
|
+
readonly crypto: any;
|
|
16
|
+
readonly "node:crypto": any;
|
|
17
|
+
readonly dgram: any;
|
|
18
|
+
readonly "node:dgram": any;
|
|
19
|
+
readonly dns: any;
|
|
20
|
+
readonly "node:dns": any;
|
|
21
|
+
readonly domain: any;
|
|
22
|
+
readonly "node:domain": any;
|
|
23
|
+
readonly events: any;
|
|
24
|
+
readonly "node:events": any;
|
|
25
|
+
"fast-glob": any;
|
|
26
|
+
readonly http: any;
|
|
27
|
+
readonly "node:http": any;
|
|
28
|
+
readonly http2: any;
|
|
29
|
+
readonly "node:http2": any;
|
|
30
|
+
readonly https: any;
|
|
31
|
+
readonly "node:https": any;
|
|
32
|
+
readonly module: any;
|
|
33
|
+
readonly "node:module": any;
|
|
34
|
+
readonly net: any;
|
|
35
|
+
readonly "node:net": any;
|
|
36
|
+
readonly os: any;
|
|
37
|
+
readonly "node:os": any;
|
|
38
|
+
readonly punycode: any;
|
|
39
|
+
readonly "node:punycode": any;
|
|
40
|
+
readonly querystring: any;
|
|
41
|
+
readonly "node:querystring": any;
|
|
42
|
+
readonly readline: any;
|
|
43
|
+
readonly "node:readline": any;
|
|
44
|
+
readonly repl: any;
|
|
45
|
+
readonly "node:repl": any;
|
|
46
|
+
readonly stream: any;
|
|
47
|
+
readonly "node:stream": any;
|
|
48
|
+
readonly string_decoder: any;
|
|
49
|
+
readonly "node:string_decoder": any;
|
|
50
|
+
readonly sys: any;
|
|
51
|
+
readonly "node:sys": any;
|
|
52
|
+
readonly timers: any;
|
|
53
|
+
readonly "node:timers": any;
|
|
54
|
+
readonly tls: any;
|
|
55
|
+
readonly "node:tls": any;
|
|
56
|
+
readonly tty: any;
|
|
57
|
+
readonly "node:tty": any;
|
|
58
|
+
readonly vm: any;
|
|
59
|
+
readonly "node:vm": any;
|
|
60
|
+
readonly zlib: any;
|
|
61
|
+
readonly "node:zlib": any;
|
|
62
|
+
fs: typeof fs;
|
|
63
|
+
"node:fs": typeof fs;
|
|
64
|
+
"graceful-fs": typeof fs;
|
|
65
|
+
path: any;
|
|
66
|
+
"node:path": any;
|
|
67
|
+
process: any;
|
|
68
|
+
"node:process": any;
|
|
69
|
+
readonly url: any;
|
|
70
|
+
readonly "node:url": any;
|
|
71
|
+
readonly util: any;
|
|
72
|
+
readonly "node:util": any;
|
|
73
|
+
worker_threads: {
|
|
74
|
+
workerData: any;
|
|
75
|
+
threadId: any;
|
|
76
|
+
isMainThread: false;
|
|
77
|
+
parentPort: {
|
|
78
|
+
postMessage: (message: any) => void;
|
|
79
|
+
on: (event: string, listener: (...args: any[]) => void) => void;
|
|
80
|
+
off: (event: string, listener: (...args: any[]) => void) => void;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
"node:worker_threads": {
|
|
84
|
+
workerData: any;
|
|
85
|
+
threadId: any;
|
|
86
|
+
isMainThread: false;
|
|
87
|
+
parentPort: {
|
|
88
|
+
postMessage: (message: any) => void;
|
|
89
|
+
on: (event: string, listener: (...args: any[]) => void) => void;
|
|
90
|
+
off: (event: string, listener: (...args: any[]) => void) => void;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
export default _default;
|