@evobug_com/safe-ts-feature-node 0.2.0 → 0.3.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/README.md +2 -2
- package/node-api.json +48 -85
- package/package.json +162 -3
- package/safe/buffer.d.ts +155 -0
- package/safe/buffer.js +582 -0
- package/safe/child_process.d.ts +32 -0
- package/safe/child_process.js +21 -0
- package/safe/core.d.ts +36 -0
- package/safe/core.js +25 -0
- package/safe/crypto.d.ts +105 -0
- package/safe/crypto.js +205 -0
- package/safe/dgram.d.ts +26 -0
- package/safe/dgram.js +76 -0
- package/safe/dns/promises.d.ts +136 -0
- package/safe/dns/promises.js +262 -0
- package/safe/errors.d.ts +155 -0
- package/safe/errors.js +32 -0
- package/safe/events.d.ts +11 -0
- package/safe/events.js +14 -0
- package/safe/ffi.d.ts +23 -0
- package/safe/ffi.js +57 -0
- package/safe/fs/promises.d.ts +168 -0
- package/safe/fs/promises.js +366 -0
- package/safe/fs.d.ts +201 -0
- package/safe/fs.js +422 -0
- package/safe/globals.d.ts +87 -0
- package/safe/globals.js +232 -0
- package/safe/http.d.ts +34 -0
- package/safe/http.js +85 -0
- package/safe/http2.d.ts +26 -0
- package/safe/http2.js +61 -0
- package/safe/https.d.ts +21 -0
- package/safe/https.js +29 -0
- package/safe/inspector/promises.d.ts +200 -0
- package/safe/inspector/promises.js +13 -0
- package/safe/inspector.d.ts +8 -0
- package/safe/inspector.js +13 -0
- package/safe/module.d.ts +21 -0
- package/safe/module.js +45 -0
- package/safe/net.d.ts +11 -0
- package/safe/net.js +17 -0
- package/safe/os.d.ts +20 -0
- package/safe/os.js +29 -0
- package/safe/perf_hooks.d.ts +11 -0
- package/safe/perf_hooks.js +12 -0
- package/safe/process.d.ts +31 -0
- package/safe/process.js +97 -0
- package/safe/punycode.d.ts +10 -0
- package/safe/punycode.js +21 -0
- package/safe/querystring.d.ts +11 -0
- package/safe/querystring.js +21 -0
- package/safe/readline/promises.d.ts +12 -0
- package/safe/readline/promises.js +13 -0
- package/safe/runtime.d.ts +10 -0
- package/safe/runtime.js +16 -0
- package/safe/sqlite.d.ts +54 -0
- package/safe/sqlite.js +118 -0
- package/safe/stream/consumers.d.ts +19 -0
- package/safe/stream/consumers.js +54 -0
- package/safe/stream/promises.d.ts +26 -0
- package/safe/stream/promises.js +22 -0
- package/safe/stream/web.d.ts +18 -0
- package/safe/stream/web.js +37 -0
- package/safe/stream.d.ts +29 -0
- package/safe/stream.js +62 -0
- package/safe/tls.d.ts +27 -0
- package/safe/tls.js +65 -0
- package/safe/url.d.ts +28 -0
- package/safe/url.js +57 -0
- package/safe/util.d.ts +13 -0
- package/safe/util.js +25 -0
- package/safe/v8.d.ts +28 -0
- package/safe/v8.js +85 -0
- package/safe/vm.d.ts +23 -0
- package/safe/vm.js +69 -0
- package/safe/wasi.d.ts +10 -0
- package/safe/wasi.js +20 -0
- package/safe/worker_threads.d.ts +31 -0
- package/safe/worker_threads.js +62 -0
- package/safe/zlib.d.ts +61 -0
- package/safe/zlib.js +214 -0
- package/safe-ts.json +1722 -490
package/safe/fs.d.ts
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
// Generated from node-api.json and @types/node by `npm run generate:safe` (packages/pack-kit/generate.ts): do not edit.
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import type { Option, Result } from "@evobug_com/safe-ts-std/result";
|
|
4
|
+
import type { NodeError, SystemError } from "./errors.js";
|
|
5
|
+
import type * as $buffer from "node:buffer";
|
|
6
|
+
import type * as $fs from "node:fs";
|
|
7
|
+
import type * as $url from "node:url";
|
|
8
|
+
export * from "node:fs";
|
|
9
|
+
|
|
10
|
+
/** `accessSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'access', path}`. */
|
|
11
|
+
export declare function accessSync(path: $fs.PathLike, mode?: number): Result<void, SystemError<"access", { path: string }>>;
|
|
12
|
+
/** `appendFileSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'open' | 'write', path?}`. */
|
|
13
|
+
export declare function appendFileSync(path: $fs.PathOrFileDescriptor, data: string | Uint8Array, options?: $fs.WriteFileOptions): Result<void, SystemError<"open" | "write", { path?: string }>>;
|
|
14
|
+
/** `chmodSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'chmod', path}`. */
|
|
15
|
+
export declare function chmodSync(path: $fs.PathLike, mode: $fs.Mode): Result<void, SystemError<"chmod", { path: string }>>;
|
|
16
|
+
/** `chownSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'chown', path}`. */
|
|
17
|
+
export declare function chownSync(path: $fs.PathLike, uid: number, gid: number): Result<void, SystemError<"chown", { path: string }>>;
|
|
18
|
+
/** `closeSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'close'}`. */
|
|
19
|
+
export declare function closeSync(fd: number): Result<void, SystemError<"close">>;
|
|
20
|
+
/** `copyFileSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'copyfile', path, dest}`. */
|
|
21
|
+
export declare function copyFileSync(src: $fs.PathLike, dest: $fs.PathLike, mode?: number): Result<void, SystemError<"copyfile", { path: string; dest: string }>>;
|
|
22
|
+
/** `cpSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall, path?, dest?} | Error [ERR_FS_CP_* | ERR_FS_EISDIR]`. */
|
|
23
|
+
export declare function cpSync(source: string | $url.URL, destination: string | $url.URL, opts?: $fs.CopySyncOptions): Result<void, SystemError<string, { path?: string; dest?: string }> | NodeError<`ERR_FS_CP_${string}` | "ERR_FS_EISDIR">>;
|
|
24
|
+
/** `Dir#close()` (node:fs), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall}`. */
|
|
25
|
+
export declare function dirClose(dir: $fs.Dir): Promise<Result<void, SystemError<string>>>;
|
|
26
|
+
/** `Dir#close()` (node:fs), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall}`. */
|
|
27
|
+
export declare function dirClose(dir: $fs.Dir, cb: $fs.NoParamCallback): Promise<Result<Awaited<void>, SystemError<string>>>;
|
|
28
|
+
/** `Dir#closeSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall}`. */
|
|
29
|
+
export declare function dirCloseSync(dir: $fs.Dir): Result<void, SystemError<string>>;
|
|
30
|
+
/** `Dir#read()` (node:fs), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall}`; a `null` it resolves to as `undefined`. */
|
|
31
|
+
export declare function dirRead(dir: $fs.Dir): Promise<Result<Option<$fs.Dirent>, SystemError<string>>>;
|
|
32
|
+
/** `Dir#read()` (node:fs), with what it rejects with returned as an `Err`: `Error [E*] {errno, syscall}`; a `null` it resolves to as `undefined`. */
|
|
33
|
+
export declare function dirRead(dir: $fs.Dir, cb: (err: NodeJS.ErrnoException | null, dirEnt: $fs.Dirent | null) => void): Promise<Result<Awaited<void>, SystemError<string>>>;
|
|
34
|
+
/** `Dir#readSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall}`; `null` returned as `undefined`. */
|
|
35
|
+
export declare function dirReadSync(dir: $fs.Dir): Result<Option<$fs.Dirent>, SystemError<string>>;
|
|
36
|
+
/** `fchmodSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'fchmod'}`. */
|
|
37
|
+
export declare function fchmodSync(fd: number, mode: $fs.Mode): Result<void, SystemError<"fchmod">>;
|
|
38
|
+
/** `fchownSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'fchown'}`. */
|
|
39
|
+
export declare function fchownSync(fd: number, uid: number, gid: number): Result<void, SystemError<"fchown">>;
|
|
40
|
+
/** `fdatasyncSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'fdatasync'}`. */
|
|
41
|
+
export declare function fdatasyncSync(fd: number): Result<void, SystemError<"fdatasync">>;
|
|
42
|
+
/** `Utf8Stream#flushSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'write' | 'fsync'}`. */
|
|
43
|
+
export declare function flushSync(utf8Stream: $fs.Utf8Stream): Result<void, SystemError<"write" | "fsync">>;
|
|
44
|
+
/** `fstatSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'fstat'}`. */
|
|
45
|
+
export declare function fstatSync(fd: number, options?: $fs.StatOptions & { bigint?: false | undefined; }): Result<$fs.Stats, SystemError<"fstat">>;
|
|
46
|
+
/** `fstatSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'fstat'}`. */
|
|
47
|
+
export declare function fstatSync(fd: number, options: $fs.StatOptions & { bigint: true; }): Result<$fs.BigIntStats, SystemError<"fstat">>;
|
|
48
|
+
/** `fstatSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'fstat'}`. */
|
|
49
|
+
export declare function fstatSync(fd: number, options?: $fs.StatOptions): Result<$fs.Stats | $fs.BigIntStats, SystemError<"fstat">>;
|
|
50
|
+
/** `fsyncSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'fsync'}`. */
|
|
51
|
+
export declare function fsyncSync(fd: number): Result<void, SystemError<"fsync">>;
|
|
52
|
+
/** `ftruncateSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'ftruncate'}`. */
|
|
53
|
+
export declare function ftruncateSync(fd: number, len?: number): Result<void, SystemError<"ftruncate">>;
|
|
54
|
+
/** `futimesSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'futime'}`. */
|
|
55
|
+
export declare function futimesSync(fd: number, atime: $fs.TimeLike, mtime: $fs.TimeLike): Result<void, SystemError<"futime">>;
|
|
56
|
+
/** `lchmodSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'open' | 'fchmod' | 'close', path?}`. */
|
|
57
|
+
export declare function lchmodSync(path: $fs.PathLike, mode: $fs.Mode): Result<void, SystemError<"open" | "fchmod" | "close", { path?: string }>>;
|
|
58
|
+
/** `lchownSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'lchown', path}`. */
|
|
59
|
+
export declare function lchownSync(path: $fs.PathLike, uid: number, gid: number): Result<void, SystemError<"lchown", { path: string }>>;
|
|
60
|
+
/** `linkSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'link', path, dest}`. */
|
|
61
|
+
export declare function linkSync(existingPath: $fs.PathLike, newPath: $fs.PathLike): Result<void, SystemError<"link", { path: string; dest: string }>>;
|
|
62
|
+
/** `lstatSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'lstat', path}`. */
|
|
63
|
+
export declare function lstatSync(path: $fs.PathLike): Result<$fs.Stats, SystemError<"lstat", { path: string }>>;
|
|
64
|
+
/** `lstatSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'lstat', path}`. */
|
|
65
|
+
export declare function lstatSync(path: $fs.PathLike, options?: $fs.StatOptions & { bigint?: false | undefined; throwIfNoEntry?: true | undefined; }): Result<$fs.Stats, SystemError<"lstat", { path: string }>>;
|
|
66
|
+
/** `lstatSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'lstat', path}`. */
|
|
67
|
+
export declare function lstatSync(path: $fs.PathLike, options: $fs.StatOptions & { bigint: true; throwIfNoEntry?: true | undefined; }): Result<$fs.BigIntStats, SystemError<"lstat", { path: string }>>;
|
|
68
|
+
/** `lstatSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'lstat', path}`. */
|
|
69
|
+
export declare function lstatSync(path: $fs.PathLike, options: $fs.StatOptions & { bigint?: false | undefined; throwIfNoEntry: false; }): Result<$fs.Stats | undefined, SystemError<"lstat", { path: string }>>;
|
|
70
|
+
/** `lstatSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'lstat', path}`. */
|
|
71
|
+
export declare function lstatSync(path: $fs.PathLike, options: $fs.StatOptions & { bigint: true; throwIfNoEntry: false; }): Result<$fs.BigIntStats | undefined, SystemError<"lstat", { path: string }>>;
|
|
72
|
+
/** `lstatSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'lstat', path}`. */
|
|
73
|
+
export declare function lstatSync(path: $fs.PathLike, options: $fs.StatOptions & { throwIfNoEntry?: true | undefined; }): Result<$fs.Stats | $fs.BigIntStats, SystemError<"lstat", { path: string }>>;
|
|
74
|
+
/** `lstatSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'lstat', path}`. */
|
|
75
|
+
export declare function lstatSync(path: $fs.PathLike, options?: $fs.StatOptions): Result<$fs.Stats | $fs.BigIntStats | undefined, SystemError<"lstat", { path: string }>>;
|
|
76
|
+
/** `lutimesSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'lutime', path}`. */
|
|
77
|
+
export declare function lutimesSync(path: $fs.PathLike, atime: $fs.TimeLike, mtime: $fs.TimeLike): Result<void, SystemError<"lutime", { path: string }>>;
|
|
78
|
+
/** `mkdirSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'mkdir', path}`. */
|
|
79
|
+
export declare function mkdirSync(path: $fs.PathLike, options: $fs.MakeDirectoryOptions & { recursive: true; }): Result<string | undefined, SystemError<"mkdir", { path: string }>>;
|
|
80
|
+
/** `mkdirSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'mkdir', path}`. */
|
|
81
|
+
export declare function mkdirSync(path: $fs.PathLike, options?: $fs.Mode | ($fs.MakeDirectoryOptions & { recursive?: false | undefined; })): Result<void, SystemError<"mkdir", { path: string }>>;
|
|
82
|
+
/** `mkdirSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'mkdir', path}`. */
|
|
83
|
+
export declare function mkdirSync(path: $fs.PathLike, options?: $fs.Mode | $fs.MakeDirectoryOptions): Result<string | undefined, SystemError<"mkdir", { path: string }>>;
|
|
84
|
+
/** `mkdtempDisposableSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'mkdtemp', path}`. */
|
|
85
|
+
export declare function mkdtempDisposableSync(prefix: string, options?: $fs.EncodingOption): Result<$fs.DisposableTempDir, SystemError<"mkdtemp", { path: string }>>;
|
|
86
|
+
/** `mkdtempSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'mkdtemp', path}`. */
|
|
87
|
+
export declare function mkdtempSync(prefix: string, options?: $fs.EncodingOption): Result<string, SystemError<"mkdtemp", { path: string }>>;
|
|
88
|
+
/** `mkdtempSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'mkdtemp', path}`. */
|
|
89
|
+
export declare function mkdtempSync(prefix: string, options: $fs.BufferEncodingOption): Result<$buffer.NonSharedBuffer, SystemError<"mkdtemp", { path: string }>>;
|
|
90
|
+
/** `mkdtempSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'mkdtemp', path}`. */
|
|
91
|
+
export declare function mkdtempSync(prefix: string, options?: $fs.EncodingOption): Result<string | $buffer.NonSharedBuffer, SystemError<"mkdtemp", { path: string }>>;
|
|
92
|
+
/** `new Utf8Stream()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'open', path}`. */
|
|
93
|
+
export declare function newUtf8Stream(options: $fs.Utf8StreamOptions): Result<$fs.Utf8Stream, SystemError<"open", { path: string }>>;
|
|
94
|
+
/** `openAsBlob()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'stat', path}`. */
|
|
95
|
+
export declare function openAsBlob(path: $fs.PathLike, options?: $fs.OpenAsBlobOptions): Result<Promise<Blob>, SystemError<"stat", { path: string }>>;
|
|
96
|
+
/** `opendirSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'opendir', path?}`. */
|
|
97
|
+
export declare function opendirSync(path: $fs.PathLike, options?: $fs.OpenDirOptions): Result<$fs.Dir, SystemError<"opendir", { path?: string }>>;
|
|
98
|
+
/** `openSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'open', path}`. */
|
|
99
|
+
export declare function openSync(path: $fs.PathLike, flags: $fs.OpenMode, mode?: $fs.Mode): Result<number, SystemError<"open", { path: string }>>;
|
|
100
|
+
/** `readdirSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'scandir', path}`. */
|
|
101
|
+
export declare function readdirSync(path: $fs.PathLike, options?: { encoding: BufferEncoding | null; withFileTypes?: false | undefined; recursive?: boolean | undefined; } | BufferEncoding): Result<string[], SystemError<"scandir", { path: string }>>;
|
|
102
|
+
/** `readdirSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'scandir', path}`. */
|
|
103
|
+
export declare function readdirSync(path: $fs.PathLike, options: { encoding: "buffer"; withFileTypes?: false | undefined; recursive?: boolean | undefined; } | "buffer"): Result<$buffer.NonSharedBuffer[], SystemError<"scandir", { path: string }>>;
|
|
104
|
+
/** `readdirSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'scandir', path}`. */
|
|
105
|
+
export declare function readdirSync(path: $fs.PathLike, options?: ($fs.ObjectEncodingOptions & { withFileTypes?: false | undefined; recursive?: boolean | undefined; }) | BufferEncoding): Result<string[] | $buffer.NonSharedBuffer[], SystemError<"scandir", { path: string }>>;
|
|
106
|
+
/** `readdirSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'scandir', path}`. */
|
|
107
|
+
export declare function readdirSync(path: $fs.PathLike, options: $fs.ObjectEncodingOptions & { withFileTypes: true; recursive?: boolean | undefined; }): Result<$fs.Dirent[], SystemError<"scandir", { path: string }>>;
|
|
108
|
+
/** `readdirSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'scandir', path}`. */
|
|
109
|
+
export declare function readdirSync(path: $fs.PathLike, options: { encoding: "buffer"; withFileTypes: true; recursive?: boolean | undefined; }): Result<$fs.Dirent<$buffer.NonSharedBuffer>[], SystemError<"scandir", { path: string }>>;
|
|
110
|
+
/** `readFileSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'open' | 'fstat' | 'read', path?}`. */
|
|
111
|
+
export declare function readFileSync<T extends NodeJS.ArrayBufferView>(path: $fs.PathOrFileDescriptor, options: $fs.ReadFileSyncOptionsWithBuffer<T>): Result<$buffer.BufferView<T>, SystemError<"open" | "fstat" | "read", { path?: string }>>;
|
|
112
|
+
/** `readFileSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'open' | 'fstat' | 'read', path?}`. */
|
|
113
|
+
export declare function readFileSync(path: $fs.PathOrFileDescriptor, options?: $fs.ReadFileSyncOptionsWithBufferEncoding): Result<$buffer.NonSharedBuffer, SystemError<"open" | "fstat" | "read", { path?: string }>>;
|
|
114
|
+
/** `readFileSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'open' | 'fstat' | 'read', path?}`. */
|
|
115
|
+
export declare function readFileSync(path: $fs.PathOrFileDescriptor, options: $fs.ReadFileSyncOptionsWithStringEncoding | BufferEncoding): Result<string, SystemError<"open" | "fstat" | "read", { path?: string }>>;
|
|
116
|
+
/** `readFileSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'open' | 'fstat' | 'read', path?}`. */
|
|
117
|
+
export declare function readFileSync(path: $fs.PathOrFileDescriptor, options: $fs.ReadFileSyncOptions): Result<string | $buffer.NonSharedBuffer, SystemError<"open" | "fstat" | "read", { path?: string }>>;
|
|
118
|
+
/** `readlinkSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'readlink', path}`. */
|
|
119
|
+
export declare function readlinkSync(path: $fs.PathLike, options?: $fs.EncodingOption): Result<string, SystemError<"readlink", { path: string }>>;
|
|
120
|
+
/** `readlinkSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'readlink', path}`. */
|
|
121
|
+
export declare function readlinkSync(path: $fs.PathLike, options: $fs.BufferEncodingOption): Result<$buffer.NonSharedBuffer, SystemError<"readlink", { path: string }>>;
|
|
122
|
+
/** `readlinkSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'readlink', path}`. */
|
|
123
|
+
export declare function readlinkSync(path: $fs.PathLike, options?: $fs.EncodingOption): Result<string | $buffer.NonSharedBuffer, SystemError<"readlink", { path: string }>>;
|
|
124
|
+
/** `readSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'read'}`. */
|
|
125
|
+
export declare function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: $fs.ReadPosition | null): Result<number, SystemError<"read">>;
|
|
126
|
+
/** `readSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'read'}`. */
|
|
127
|
+
export declare function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: $fs.ReadOptions): Result<number, SystemError<"read">>;
|
|
128
|
+
/** `readv()` (node:fs), with `undefined` passed on as `null` for the third argument. */
|
|
129
|
+
export declare function readv<TBuffers extends readonly NodeJS.ArrayBufferView[]>(fd: number, buffers: TBuffers, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: TBuffers) => void): void;
|
|
130
|
+
/** `readv()` (node:fs), with `undefined` passed on as `null` for the third argument. */
|
|
131
|
+
export declare function readv<TBuffers extends readonly NodeJS.ArrayBufferView[]>(fd: number, buffers: TBuffers, position: Option<number>, cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: TBuffers) => void): void;
|
|
132
|
+
/** `readvSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'read'}`. */
|
|
133
|
+
export declare function readvSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): Result<number, SystemError<"read">>;
|
|
134
|
+
/** `realpathSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'lstat' | 'stat' | 'readlink', path}`. */
|
|
135
|
+
export declare function realpathSync(path: $fs.PathLike, options?: $fs.EncodingOption): Result<string, SystemError<"lstat" | "stat" | "readlink", { path: string }>>;
|
|
136
|
+
/** `realpathSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'lstat' | 'stat' | 'readlink', path}`. */
|
|
137
|
+
export declare function realpathSync(path: $fs.PathLike, options: $fs.BufferEncodingOption): Result<$buffer.NonSharedBuffer, SystemError<"lstat" | "stat" | "readlink", { path: string }>>;
|
|
138
|
+
/** `realpathSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'lstat' | 'stat' | 'readlink', path}`. */
|
|
139
|
+
export declare function realpathSync(path: $fs.PathLike, options?: $fs.EncodingOption): Result<string | $buffer.NonSharedBuffer, SystemError<"lstat" | "stat" | "readlink", { path: string }>>;
|
|
140
|
+
export declare namespace realpathSync {
|
|
141
|
+
/** `realpathSync.native()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'realpath', path}`. */
|
|
142
|
+
function native(path: $fs.PathLike, options?: $fs.EncodingOption): Result<string, SystemError<"realpath", { path: string }>>;
|
|
143
|
+
/** `realpathSync.native()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'realpath', path}`. */
|
|
144
|
+
function native(path: $fs.PathLike, options: $fs.BufferEncodingOption): Result<$buffer.NonSharedBuffer, SystemError<"realpath", { path: string }>>;
|
|
145
|
+
/** `realpathSync.native()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'realpath', path}`. */
|
|
146
|
+
function native(path: $fs.PathLike, options?: $fs.EncodingOption): Result<string | $buffer.NonSharedBuffer, SystemError<"realpath", { path: string }>>;
|
|
147
|
+
}
|
|
148
|
+
/** `renameSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'rename', path, dest}`. */
|
|
149
|
+
export declare function renameSync(oldPath: $fs.PathLike, newPath: $fs.PathLike): Result<void, SystemError<"rename", { path: string; dest: string }>>;
|
|
150
|
+
/** `rmdirSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'rmdir', path}`. */
|
|
151
|
+
export declare function rmdirSync(path: $fs.PathLike): Result<void, SystemError<"rmdir", { path: string }>>;
|
|
152
|
+
/** `rmSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall, path} | SystemError [ERR_FS_EISDIR] {info, errno, syscall: 'rm', path}`. */
|
|
153
|
+
export declare function rmSync(path: $fs.PathLike, options?: $fs.RmOptions): Result<void, SystemError<string, { path: string }> | NodeError<"ERR_FS_EISDIR", "SystemError", { info: { errno: number; code: string; message: string; syscall: string; path?: string; dest?: string }; errno: number; syscall: "rm"; path: string }>>;
|
|
154
|
+
/** `statfsSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'statfs', path}`. */
|
|
155
|
+
export declare function statfsSync(path: $fs.PathLike, options?: $fs.StatFsOptions & { bigint?: false | undefined; }): Result<$fs.StatsFs, SystemError<"statfs", { path: string }>>;
|
|
156
|
+
/** `statfsSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'statfs', path}`. */
|
|
157
|
+
export declare function statfsSync(path: $fs.PathLike, options: $fs.StatFsOptions & { bigint: true; }): Result<$fs.BigIntStatsFs, SystemError<"statfs", { path: string }>>;
|
|
158
|
+
/** `statfsSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'statfs', path}`. */
|
|
159
|
+
export declare function statfsSync(path: $fs.PathLike, options?: $fs.StatFsOptions): Result<$fs.StatsFs | $fs.BigIntStatsFs, SystemError<"statfs", { path: string }>>;
|
|
160
|
+
/** `statSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'stat', path}`. */
|
|
161
|
+
export declare function statSync(path: $fs.PathLike): Result<$fs.Stats, SystemError<"stat", { path: string }>>;
|
|
162
|
+
/** `statSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'stat', path}`. */
|
|
163
|
+
export declare function statSync(path: $fs.PathLike, options?: $fs.StatOptions & { bigint?: false | undefined; throwIfNoEntry?: true | undefined; }): Result<$fs.Stats, SystemError<"stat", { path: string }>>;
|
|
164
|
+
/** `statSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'stat', path}`. */
|
|
165
|
+
export declare function statSync(path: $fs.PathLike, options: $fs.StatOptions & { bigint: true; throwIfNoEntry?: true | undefined; }): Result<$fs.BigIntStats, SystemError<"stat", { path: string }>>;
|
|
166
|
+
/** `statSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'stat', path}`. */
|
|
167
|
+
export declare function statSync(path: $fs.PathLike, options: $fs.StatOptions & { bigint?: false | undefined; throwIfNoEntry: false; }): Result<$fs.Stats | undefined, SystemError<"stat", { path: string }>>;
|
|
168
|
+
/** `statSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'stat', path}`. */
|
|
169
|
+
export declare function statSync(path: $fs.PathLike, options: $fs.StatOptions & { bigint: true; throwIfNoEntry: false; }): Result<$fs.BigIntStats | undefined, SystemError<"stat", { path: string }>>;
|
|
170
|
+
/** `statSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'stat', path}`. */
|
|
171
|
+
export declare function statSync(path: $fs.PathLike, options: $fs.StatOptions & { throwIfNoEntry?: true | undefined; }): Result<$fs.Stats | $fs.BigIntStats, SystemError<"stat", { path: string }>>;
|
|
172
|
+
/** `statSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'stat', path}`. */
|
|
173
|
+
export declare function statSync(path: $fs.PathLike, options?: $fs.StatOptions): Result<$fs.Stats | $fs.BigIntStats | undefined, SystemError<"stat", { path: string }>>;
|
|
174
|
+
/** `symlinkSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'symlink', path, dest}`. */
|
|
175
|
+
export declare function symlinkSync(target: $fs.PathLike, path: $fs.PathLike, type?: $fs.symlink.Type): Result<void, SystemError<"symlink", { path: string; dest: string }>>;
|
|
176
|
+
/** `truncateSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'open' | 'ftruncate', path?}`. */
|
|
177
|
+
export declare function truncateSync(path: $fs.PathLike, len?: number): Result<void, SystemError<"open" | "ftruncate", { path?: string }>>;
|
|
178
|
+
/** `unlinkSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'unlink', path}`. */
|
|
179
|
+
export declare function unlinkSync(path: $fs.PathLike): Result<void, SystemError<"unlink", { path: string }>>;
|
|
180
|
+
/** `utimesSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'utime', path}`. */
|
|
181
|
+
export declare function utimesSync(path: $fs.PathLike, atime: $fs.TimeLike, mtime: $fs.TimeLike): Result<void, SystemError<"utime", { path: string }>>;
|
|
182
|
+
/** `watch()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'watch', path, filename}`. */
|
|
183
|
+
export declare function watch(filename: $fs.PathLike, options?: $fs.WatchOptionsWithStringEncoding | BufferEncoding | null, listener?: $fs.WatchListener<string>): Result<$fs.FSWatcher, SystemError<"watch", { path: string; filename: string }>>;
|
|
184
|
+
/** `watch()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'watch', path, filename}`. */
|
|
185
|
+
export declare function watch(filename: $fs.PathLike, options: $fs.WatchOptionsWithBufferEncoding | "buffer", listener: $fs.WatchListener<$buffer.NonSharedBuffer>): Result<$fs.FSWatcher, SystemError<"watch", { path: string; filename: string }>>;
|
|
186
|
+
/** `watch()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'watch', path, filename}`. */
|
|
187
|
+
export declare function watch(filename: $fs.PathLike, options: $fs.WatchOptions | BufferEncoding | "buffer" | null, listener: $fs.WatchListener<string | $buffer.NonSharedBuffer>): Result<$fs.FSWatcher, SystemError<"watch", { path: string; filename: string }>>;
|
|
188
|
+
/** `watch()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'watch', path, filename}`. */
|
|
189
|
+
export declare function watch(filename: $fs.PathLike, listener: $fs.WatchListener<string>): Result<$fs.FSWatcher, SystemError<"watch", { path: string; filename: string }>>;
|
|
190
|
+
/** `writeFileSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'open' | 'write', path?}`. */
|
|
191
|
+
export declare function writeFileSync(file: $fs.PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options?: $fs.WriteFileOptions): Result<void, SystemError<"open" | "write", { path?: string }>>;
|
|
192
|
+
/** `writeSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'write'}`. */
|
|
193
|
+
export declare function writeSync(fd: number, buffer: NodeJS.ArrayBufferView, offset?: number, length?: number, position?: number): Result<number, SystemError<"write">>;
|
|
194
|
+
/** `writeSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'write'}`. */
|
|
195
|
+
export declare function writeSync(fd: number, string: string, position?: number, encoding?: BufferEncoding): Result<number, SystemError<"write">>;
|
|
196
|
+
/** `writev()` (node:fs), with `undefined` passed on as `null` for the third argument. */
|
|
197
|
+
export declare function writev<TBuffers extends readonly NodeJS.ArrayBufferView[]>(fd: number, buffers: TBuffers, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: TBuffers) => void): void;
|
|
198
|
+
/** `writev()` (node:fs), with `undefined` passed on as `null` for the third argument. */
|
|
199
|
+
export declare function writev<TBuffers extends readonly NodeJS.ArrayBufferView[]>(fd: number, buffers: TBuffers, position: Option<number>, cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: TBuffers) => void): void;
|
|
200
|
+
/** `writevSync()` (node:fs), with what it throws returned as an `Err`: `Error [E*] {errno, syscall: 'write'}`. */
|
|
201
|
+
export declare function writevSync(fd: number, buffers: readonly NodeJS.ArrayBufferView[], position?: number): Result<number, SystemError<"write">>;
|
package/safe/fs.js
ADDED
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
// @safe-ts std
|
|
2
|
+
// Generated from node-api.json and @types/node by `npm run generate:safe` (packages/pack-kit/generate.ts): do not edit.
|
|
3
|
+
import * as $module from "node:fs";
|
|
4
|
+
import { Err } from "@evobug_com/safe-ts-std/result";
|
|
5
|
+
import { failed, ok, option } from "./runtime.js";
|
|
6
|
+
export * from "node:fs";
|
|
7
|
+
|
|
8
|
+
export function accessSync(...args) {
|
|
9
|
+
try {
|
|
10
|
+
return $module.accessSync(...args);
|
|
11
|
+
} catch (error) {
|
|
12
|
+
return new Err(error);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function appendFileSync(...args) {
|
|
17
|
+
try {
|
|
18
|
+
return $module.appendFileSync(...args);
|
|
19
|
+
} catch (error) {
|
|
20
|
+
return new Err(error);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function chmodSync(...args) {
|
|
25
|
+
try {
|
|
26
|
+
return $module.chmodSync(...args);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
return new Err(error);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function chownSync(...args) {
|
|
33
|
+
try {
|
|
34
|
+
return $module.chownSync(...args);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
return new Err(error);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function closeSync(...args) {
|
|
41
|
+
try {
|
|
42
|
+
return $module.closeSync(...args);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
return new Err(error);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function copyFileSync(...args) {
|
|
49
|
+
try {
|
|
50
|
+
return $module.copyFileSync(...args);
|
|
51
|
+
} catch (error) {
|
|
52
|
+
return new Err(error);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function cpSync(...args) {
|
|
57
|
+
try {
|
|
58
|
+
return $module.cpSync(...args);
|
|
59
|
+
} catch (error) {
|
|
60
|
+
return new Err(error);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function dirClose(self, ...args) {
|
|
65
|
+
try {
|
|
66
|
+
return Promise.resolve(self.close(...args)).then(ok, failed);
|
|
67
|
+
} catch (error) {
|
|
68
|
+
return Promise.resolve(new Err(error));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function dirCloseSync(self, ...args) {
|
|
73
|
+
try {
|
|
74
|
+
return self.closeSync(...args);
|
|
75
|
+
} catch (error) {
|
|
76
|
+
return new Err(error);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function dirRead(self, ...args) {
|
|
81
|
+
try {
|
|
82
|
+
return Promise.resolve(self.read(...args)).then(option, failed);
|
|
83
|
+
} catch (error) {
|
|
84
|
+
return Promise.resolve(new Err(error));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function dirReadSync(self, ...args) {
|
|
89
|
+
try {
|
|
90
|
+
return self.readSync(...args) ?? undefined;
|
|
91
|
+
} catch (error) {
|
|
92
|
+
return new Err(error);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function fchmodSync(...args) {
|
|
97
|
+
try {
|
|
98
|
+
return $module.fchmodSync(...args);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
return new Err(error);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function fchownSync(...args) {
|
|
105
|
+
try {
|
|
106
|
+
return $module.fchownSync(...args);
|
|
107
|
+
} catch (error) {
|
|
108
|
+
return new Err(error);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export function fdatasyncSync(...args) {
|
|
113
|
+
try {
|
|
114
|
+
return $module.fdatasyncSync(...args);
|
|
115
|
+
} catch (error) {
|
|
116
|
+
return new Err(error);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function flushSync(self, ...args) {
|
|
121
|
+
try {
|
|
122
|
+
return self.flushSync(...args);
|
|
123
|
+
} catch (error) {
|
|
124
|
+
return new Err(error);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function fstatSync(...args) {
|
|
129
|
+
try {
|
|
130
|
+
return $module.fstatSync(...args);
|
|
131
|
+
} catch (error) {
|
|
132
|
+
return new Err(error);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function fsyncSync(...args) {
|
|
137
|
+
try {
|
|
138
|
+
return $module.fsyncSync(...args);
|
|
139
|
+
} catch (error) {
|
|
140
|
+
return new Err(error);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function ftruncateSync(...args) {
|
|
145
|
+
try {
|
|
146
|
+
return $module.ftruncateSync(...args);
|
|
147
|
+
} catch (error) {
|
|
148
|
+
return new Err(error);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export function futimesSync(...args) {
|
|
153
|
+
try {
|
|
154
|
+
return $module.futimesSync(...args);
|
|
155
|
+
} catch (error) {
|
|
156
|
+
return new Err(error);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export function lchmodSync(...args) {
|
|
161
|
+
try {
|
|
162
|
+
return $module.lchmodSync(...args);
|
|
163
|
+
} catch (error) {
|
|
164
|
+
return new Err(error);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export function lchownSync(...args) {
|
|
169
|
+
try {
|
|
170
|
+
return $module.lchownSync(...args);
|
|
171
|
+
} catch (error) {
|
|
172
|
+
return new Err(error);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function linkSync(...args) {
|
|
177
|
+
try {
|
|
178
|
+
return $module.linkSync(...args);
|
|
179
|
+
} catch (error) {
|
|
180
|
+
return new Err(error);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export function lstatSync(...args) {
|
|
185
|
+
try {
|
|
186
|
+
return $module.lstatSync(...args);
|
|
187
|
+
} catch (error) {
|
|
188
|
+
return new Err(error);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export function lutimesSync(...args) {
|
|
193
|
+
try {
|
|
194
|
+
return $module.lutimesSync(...args);
|
|
195
|
+
} catch (error) {
|
|
196
|
+
return new Err(error);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export function mkdirSync(...args) {
|
|
201
|
+
try {
|
|
202
|
+
return $module.mkdirSync(...args);
|
|
203
|
+
} catch (error) {
|
|
204
|
+
return new Err(error);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export function mkdtempDisposableSync(...args) {
|
|
209
|
+
try {
|
|
210
|
+
return $module.mkdtempDisposableSync(...args);
|
|
211
|
+
} catch (error) {
|
|
212
|
+
return new Err(error);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export function mkdtempSync(...args) {
|
|
217
|
+
try {
|
|
218
|
+
return $module.mkdtempSync(...args);
|
|
219
|
+
} catch (error) {
|
|
220
|
+
return new Err(error);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export function newUtf8Stream(...args) {
|
|
225
|
+
try {
|
|
226
|
+
return new $module.Utf8Stream(...args);
|
|
227
|
+
} catch (error) {
|
|
228
|
+
return new Err(error);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export function openAsBlob(...args) {
|
|
233
|
+
try {
|
|
234
|
+
return $module.openAsBlob(...args);
|
|
235
|
+
} catch (error) {
|
|
236
|
+
return new Err(error);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export function opendirSync(...args) {
|
|
241
|
+
try {
|
|
242
|
+
return $module.opendirSync(...args);
|
|
243
|
+
} catch (error) {
|
|
244
|
+
return new Err(error);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export function openSync(...args) {
|
|
249
|
+
try {
|
|
250
|
+
return $module.openSync(...args);
|
|
251
|
+
} catch (error) {
|
|
252
|
+
return new Err(error);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export function readdirSync(...args) {
|
|
257
|
+
try {
|
|
258
|
+
return $module.readdirSync(...args);
|
|
259
|
+
} catch (error) {
|
|
260
|
+
return new Err(error);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export function readFileSync(...args) {
|
|
265
|
+
try {
|
|
266
|
+
return $module.readFileSync(...args);
|
|
267
|
+
} catch (error) {
|
|
268
|
+
return new Err(error);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export function readlinkSync(...args) {
|
|
273
|
+
try {
|
|
274
|
+
return $module.readlinkSync(...args);
|
|
275
|
+
} catch (error) {
|
|
276
|
+
return new Err(error);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export function readSync(...args) {
|
|
281
|
+
try {
|
|
282
|
+
return $module.readSync(...args);
|
|
283
|
+
} catch (error) {
|
|
284
|
+
return new Err(error);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export function readv(a0, a1, a2, ...args) {
|
|
289
|
+
return $module.readv(a0, a1, a2 ?? null, ...args);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export function readvSync(...args) {
|
|
293
|
+
try {
|
|
294
|
+
return $module.readvSync(...args);
|
|
295
|
+
} catch (error) {
|
|
296
|
+
return new Err(error);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export const realpathSync = /* @__PURE__ */ Object.assign(function realpathSync(...args) {
|
|
301
|
+
try {
|
|
302
|
+
return $module.realpathSync(...args);
|
|
303
|
+
} catch (error) {
|
|
304
|
+
return new Err(error);
|
|
305
|
+
}
|
|
306
|
+
}, {
|
|
307
|
+
native(...args) {
|
|
308
|
+
try {
|
|
309
|
+
return $module.realpathSync.native(...args);
|
|
310
|
+
} catch (error) {
|
|
311
|
+
return new Err(error);
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
export function renameSync(...args) {
|
|
317
|
+
try {
|
|
318
|
+
return $module.renameSync(...args);
|
|
319
|
+
} catch (error) {
|
|
320
|
+
return new Err(error);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export function rmdirSync(...args) {
|
|
325
|
+
try {
|
|
326
|
+
return $module.rmdirSync(...args);
|
|
327
|
+
} catch (error) {
|
|
328
|
+
return new Err(error);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export function rmSync(...args) {
|
|
333
|
+
try {
|
|
334
|
+
return $module.rmSync(...args);
|
|
335
|
+
} catch (error) {
|
|
336
|
+
return new Err(error);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export function statfsSync(...args) {
|
|
341
|
+
try {
|
|
342
|
+
return $module.statfsSync(...args);
|
|
343
|
+
} catch (error) {
|
|
344
|
+
return new Err(error);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export function statSync(...args) {
|
|
349
|
+
try {
|
|
350
|
+
return $module.statSync(...args);
|
|
351
|
+
} catch (error) {
|
|
352
|
+
return new Err(error);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export function symlinkSync(...args) {
|
|
357
|
+
try {
|
|
358
|
+
return $module.symlinkSync(...args);
|
|
359
|
+
} catch (error) {
|
|
360
|
+
return new Err(error);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export function truncateSync(...args) {
|
|
365
|
+
try {
|
|
366
|
+
return $module.truncateSync(...args);
|
|
367
|
+
} catch (error) {
|
|
368
|
+
return new Err(error);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export function unlinkSync(...args) {
|
|
373
|
+
try {
|
|
374
|
+
return $module.unlinkSync(...args);
|
|
375
|
+
} catch (error) {
|
|
376
|
+
return new Err(error);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export function utimesSync(...args) {
|
|
381
|
+
try {
|
|
382
|
+
return $module.utimesSync(...args);
|
|
383
|
+
} catch (error) {
|
|
384
|
+
return new Err(error);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export function watch(...args) {
|
|
389
|
+
try {
|
|
390
|
+
return $module.watch(...args);
|
|
391
|
+
} catch (error) {
|
|
392
|
+
return new Err(error);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export function writeFileSync(...args) {
|
|
397
|
+
try {
|
|
398
|
+
return $module.writeFileSync(...args);
|
|
399
|
+
} catch (error) {
|
|
400
|
+
return new Err(error);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export function writeSync(...args) {
|
|
405
|
+
try {
|
|
406
|
+
return $module.writeSync(...args);
|
|
407
|
+
} catch (error) {
|
|
408
|
+
return new Err(error);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export function writev(a0, a1, a2, ...args) {
|
|
413
|
+
return $module.writev(a0, a1, a2 ?? null, ...args);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
export function writevSync(...args) {
|
|
417
|
+
try {
|
|
418
|
+
return $module.writevSync(...args);
|
|
419
|
+
} catch (error) {
|
|
420
|
+
return new Err(error);
|
|
421
|
+
}
|
|
422
|
+
}
|