@d0paminedriven/fs 10.1.0 → 12.0.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.
Files changed (60) hide show
  1. package/dist/docs/index.d.ts +151 -0
  2. package/dist/docs/index.js +1163 -0
  3. package/dist/extract/client.d.ts +56 -0
  4. package/dist/extract/client.js +116 -0
  5. package/dist/extract/index.d.ts +66 -0
  6. package/dist/extract/index.js +620 -0
  7. package/dist/fs/index.d.ts +18 -58
  8. package/dist/fs/index.js +89 -19
  9. package/dist/fs-atomic/index.d.ts +25 -39
  10. package/dist/fs-atomic/index.js +94 -13
  11. package/dist/fs-base/index.d.ts +105 -113
  12. package/dist/fs-base/index.js +197 -12
  13. package/dist/fs-core/index.d.ts +18 -26
  14. package/dist/fs-core/index.js +43 -16
  15. package/dist/fs-fetch/index.d.ts +48 -65
  16. package/dist/fs-fetch/index.js +183 -18
  17. package/dist/fs-size/index.d.ts +15 -31
  18. package/dist/fs-size/index.js +63 -15
  19. package/dist/fs-tmp/index.d.ts +178 -195
  20. package/dist/fs-tmp/index.js +320 -17
  21. package/dist/images/index.d.ts +443 -0
  22. package/dist/images/index.js +893 -0
  23. package/dist/images/workup.d.ts +26 -0
  24. package/dist/images/workup.js +316 -0
  25. package/dist/index.d.ts +48 -22
  26. package/dist/index.js +19 -64
  27. package/dist/ld/index.d.ts +14 -16
  28. package/dist/ld/index.js +54 -6
  29. package/dist/mime/index.d.ts +301 -296
  30. package/dist/mime/index.js +348 -13
  31. package/dist/mixins/index.d.ts +30 -0
  32. package/dist/mixins/index.js +54 -0
  33. package/dist/types/index.d.ts +339 -260
  34. package/dist/types/index.js +10 -6
  35. package/dist/types/stream.d.ts +7 -9
  36. package/dist/types/stream.js +1 -1
  37. package/dist/url/index.d.ts +18 -25
  38. package/dist/url/index.js +19 -8
  39. package/dist/utils/index.d.ts +18 -26
  40. package/dist/utils/index.js +80 -7
  41. package/package.json +42 -22
  42. package/dist/chunk-4D2YBCI6.js +0 -163
  43. package/dist/chunk-5CACVZVF.js +0 -386
  44. package/dist/chunk-5H6GE5AO.js +0 -14
  45. package/dist/chunk-7QVYU63E.js +0 -7
  46. package/dist/chunk-DNR5ZI2T.js +0 -75
  47. package/dist/chunk-JZ6JNZZ6.js +0 -77
  48. package/dist/chunk-L2QMQOEJ.js +0 -366
  49. package/dist/chunk-NJHN5OE3.js +0 -33
  50. package/dist/chunk-OHKRQJZH.js +0 -82
  51. package/dist/chunk-OT5JEQKW.js +0 -139
  52. package/dist/chunk-PATMSIQK.js +0 -367
  53. package/dist/chunk-PB5A7ZFD.js +0 -79
  54. package/dist/chunk-VDKUXJE7.js +0 -240
  55. package/dist/chunk-Y5QWE4EG.js +0 -1335
  56. package/dist/chunk-YRCJWFZD.js +0 -107
  57. package/dist/image/index.d.ts +0 -182
  58. package/dist/image/index.js +0 -13
  59. package/dist/image/workup.d.ts +0 -40
  60. package/dist/image/workup.js +0 -12
package/dist/fs/index.js CHANGED
@@ -1,21 +1,91 @@
1
- import {
2
- Fs
3
- } from "../chunk-JZ6JNZZ6.js";
4
- import "../chunk-4D2YBCI6.js";
5
- import "../chunk-PATMSIQK.js";
6
- import "../chunk-OHKRQJZH.js";
7
- import "../chunk-DNR5ZI2T.js";
8
- import "../chunk-5H6GE5AO.js";
9
- import "../chunk-YRCJWFZD.js";
10
- import "../chunk-VDKUXJE7.js";
11
- import "../chunk-Y5QWE4EG.js";
12
- import "../chunk-5CACVZVF.js";
13
- import "../chunk-L2QMQOEJ.js";
14
- import "../chunk-NJHN5OE3.js";
15
- import "../chunk-OT5JEQKW.js";
16
- import "../chunk-PB5A7ZFD.js";
17
- import "../chunk-7QVYU63E.js";
18
- export {
19
- Fs as default
1
+ import { createReadStream } from "node:fs";
2
+ import { relative, resolve } from "node:path";
3
+ import { FsFetch } from "../fs-fetch/index.js";
4
+ // src/fs/index.ts
5
+ var Fs = class extends FsFetch {
6
+ cwd;
7
+ constructor(cwd) {
8
+ super(cwd ??= process.cwd());
9
+ this.cwd = cwd;
10
+ }
11
+ async getSpecs(filePath, size = 147456) {
12
+ if (URL.canParse(filePath)) return await this.extractRemote(filePath, size);
13
+ else {
14
+ const stream = createReadStream(relative(this.cwd, filePath), { highWaterMark: size });
15
+ const buffer = await this.readBytes(stream, size);
16
+ return await this.extractRemote(buffer, size);
17
+ }
18
+ }
19
+ async getSpecsFlexi(target, size = 147456) {
20
+ if (Buffer.isBuffer(target)) return this.extractRemote(target, size);
21
+ else if (URL.canParse(target)) return await this.extractRemote(target, size);
22
+ else {
23
+ const stream = createReadStream(relative(this.cwd, target), { highWaterMark: size });
24
+ const buffer = await this.readBytes(stream, size);
25
+ return this.extractRemote(buffer, size);
26
+ }
27
+ }
28
+ async getSpecsTmp(filename, size = 147456) {
29
+ const absPath = resolve(this.tmpDir, filename);
30
+ const rs = createReadStream(absPath);
31
+ const arr = Array.of();
32
+ const iterate = rs.iterator();
33
+ for await (const chunk of iterate) arr.push(chunk);
34
+ const buffer = Buffer.concat(arr);
35
+ return await this.extractRemote(buffer, size);
36
+ }
37
+ /**
38
+ * Extract image metadata using streaming (only reads ~4KB)
39
+ * Much more memory efficient for large images
40
+ */
41
+ async getSpecsStream(filePath, size = 147456) {
42
+ const stream = createReadStream(relative(this.cwd, filePath), { highWaterMark: size });
43
+ const buffer = await this.readBytes(stream, size);
44
+ return await this.extractRemote(buffer, size);
45
+ }
46
+ async getSpecsStreamTmp(filename) {
47
+ const absPath = resolve(this.tmpDir, filename);
48
+ const rs = createReadStream(absPath);
49
+ const arr = Array.of();
50
+ const iterate = rs.iterator();
51
+ for await (const chunk of iterate) arr.push(chunk);
52
+ const buffer = Buffer.concat(arr);
53
+ return await this.extractRemote(buffer);
54
+ }
55
+ async readBytes(stream, size) {
56
+ return new Promise((resolve, reject) => {
57
+ const chunks = Array.of();
58
+ let totalBytes = 0;
59
+ const cleanup = () => {
60
+ stream.removeAllListeners();
61
+ stream.destroy();
62
+ };
63
+ stream.on("error", (err) => {
64
+ cleanup();
65
+ reject(err);
66
+ });
67
+ stream.on("data", (chunk) => {
68
+ const bytes = size ?? chunk.length;
69
+ const remaining = bytes - totalBytes;
70
+ if (chunk.length <= remaining) {
71
+ chunks.push(chunk);
72
+ totalBytes += chunk.length;
73
+ } else {
74
+ chunks.push(chunk.subarray(0, remaining));
75
+ totalBytes = bytes;
76
+ }
77
+ if (totalBytes >= bytes) {
78
+ cleanup();
79
+ resolve(Buffer.concat(chunks));
80
+ }
81
+ });
82
+ stream.on("end", () => {
83
+ cleanup();
84
+ resolve(Buffer.concat(chunks));
85
+ });
86
+ });
87
+ }
20
88
  };
89
+ export { Fs as default };
90
+
21
91
  //# sourceMappingURL=index.js.map
@@ -1,40 +1,26 @@
1
- import { ExecuteCommandProps, MkDirSyncOptions, ReadDirOptions, RmOptions, NoParamCallback } from '../types/index.js';
2
- import { FsBase } from '../fs-base/index.js';
3
- import 'stream';
4
- import 'fs';
5
- import 'node:stream';
6
- import 'stream/web';
7
- import 'dotenv-expand';
8
- import '../types/stream.js';
9
- import '../image/index.js';
10
- import '@d0paminedriven/metadata';
11
- import '../image/workup.js';
12
- import '../mime/index.js';
13
- import '../url/index.js';
14
- import '../utils/index.js';
15
- import '../ld/index.js';
16
-
17
- declare class FsAtomic extends FsBase {
18
- cwd: string;
19
- constructor(cwd: string);
20
- executeCommand: <const T extends string>({ command, ...options }: ExecuteCommandProps<T>) => string;
21
- mkdirSync<const T extends string>(path: T, options?: MkDirSyncOptions): string | undefined;
22
- generateDirIfDNE<const T extends string>(path: T, options?: MkDirSyncOptions): string | undefined;
23
- fileToBuffer: <const T extends string>(path: T) => Buffer<ArrayBuffer>;
24
- fileToBufferAsync: <const T extends string>(path: T) => Promise<NonSharedBuffer>;
25
- dirContainsDir<const From extends string, const To extends string>(readDir: From, targetDir: To, options?: ReadDirOptions): boolean;
26
- rmFile<const FP extends string>(filePath: FP, options?: RmOptions): void;
27
- /**
28
- * Removes files and directories (modeled on the standard POSIX `rm` utility).
29
- * To get a behavior similar to the `rm -rf` Unix command, use options `{ recursive: true, force: true }`.
30
- * @return Fulfills with `undefined` upon success.
31
- */
32
- rmdir<const D extends string>(dir: D, options?: RmOptions): Promise<void>;
33
- rmDirSync<const D extends string>(dir: D, options?: RmOptions, callback?: NoParamCallback): void;
34
- existsTmp(path: string): boolean;
35
- mkdirTmp(path: string, options?: MkDirSyncOptions): string | undefined;
36
- generateDirIfDNETmp<const T extends string>(path: T, options?: MkDirSyncOptions): string | undefined;
37
- rmTmpFile<const V extends string>(filename: V): void;
1
+ import { ExecuteCommandProps, MkDirSyncOptions, NoParamCallback, ReadDirOptions, RmOptions } from "../types/index.js";
2
+ import { FsBase } from "../fs-base/index.js";
3
+ export declare class FsAtomic extends FsBase {
4
+ cwd: string;
5
+ constructor(cwd: string);
6
+ executeCommand: <const T extends string>({ command, ...options }: ExecuteCommandProps<T>) => Buffer<ArrayBuffer>;
7
+ mkdirSync<const T extends string>(path: T, options?: MkDirSyncOptions): string | undefined;
8
+ mkdirSyncAbs<const T extends string>(path: T, options?: MkDirSyncOptions): string | undefined;
9
+ generateDirIfDNE<const T extends string>(path: T, options?: MkDirSyncOptions): string | undefined;
10
+ fileToBuffer: <const T extends string>(path: T) => Buffer<ArrayBuffer>;
11
+ fileToBufferAsync: <const T extends string>(path: T) => Promise<NonSharedBuffer>;
12
+ dirContainsDir<const From extends string, const To extends string>(readDir: From, targetDir: To, options?: ReadDirOptions): boolean;
13
+ rmFile<const FP extends string>(filePath: FP, options?: RmOptions): void;
14
+ /**
15
+ * Removes files and directories (modeled on the standard POSIX `rm` utility).
16
+ * To get a behavior similar to the `rm -rf` Unix command, use options `{ recursive: true, force: true }`.
17
+ * @return Fulfills with `undefined` upon success.
18
+ */
19
+ rmdir<const D extends string>(dir: D, options?: RmOptions): Promise<void>;
20
+ rmDirSync<const D extends string>(dir: D, options?: RmOptions, callback?: NoParamCallback): void;
21
+ existsTmp(path: string): boolean;
22
+ mkdirTmp(path: string, options?: MkDirSyncOptions): string | undefined;
23
+ generateDirIfDNETmp<const T extends string>(path: T, options?: MkDirSyncOptions): string | undefined;
24
+ rmTmpFile<const V extends string>(filename: V): void;
38
25
  }
39
-
40
- export { FsAtomic };
26
+ //# sourceMappingURL=index.d.ts.map
@@ -1,15 +1,96 @@
1
- import {
2
- FsAtomic
3
- } from "../chunk-YRCJWFZD.js";
4
- import "../chunk-VDKUXJE7.js";
5
- import "../chunk-Y5QWE4EG.js";
6
- import "../chunk-5CACVZVF.js";
7
- import "../chunk-L2QMQOEJ.js";
8
- import "../chunk-NJHN5OE3.js";
9
- import "../chunk-OT5JEQKW.js";
10
- import "../chunk-PB5A7ZFD.js";
11
- import "../chunk-7QVYU63E.js";
12
- export {
13
- FsAtomic
1
+ import { execSync } from "node:child_process";
2
+ import fsSync from "node:fs";
3
+ import fsAsync from "node:fs/promises";
4
+ import { join, relative, resolve } from "node:path";
5
+ import { FsBase } from "../fs-base/index.js";
6
+ // src/fs-atomic/index.ts
7
+ var FsAtomic = class extends FsBase {
8
+ cwd;
9
+ constructor(cwd) {
10
+ super(cwd ??= process.cwd());
11
+ this.cwd = cwd;
12
+ }
13
+ executeCommand = ({ command, ...options }) => Buffer.from(execSync(command, { ...options }));
14
+ mkdirSync(path, options = {
15
+ mode: 511,
16
+ recursive: true
17
+ }) {
18
+ return fsSync.mkdirSync(relative(this.cwd, path), options);
19
+ }
20
+ mkdirSyncAbs(path, options = {
21
+ mode: 511,
22
+ recursive: true
23
+ }) {
24
+ return fsSync.mkdirSync(this.absPath(path), options);
25
+ }
26
+ generateDirIfDNE(path, options = {
27
+ mode: 511,
28
+ recursive: true
29
+ }) {
30
+ if (this.exists(path)) return;
31
+ else return this.mkdirSync(path, options);
32
+ }
33
+ fileToBuffer = (path) => Buffer.from(fsSync.readFileSync(relative(this.cwd, path)).toJSON().data);
34
+ fileToBufferAsync = async (path) => {
35
+ return await fsAsync.readFile(relative(this.cwd, path));
36
+ };
37
+ dirContainsDir(readDir, targetDir, options) {
38
+ return this.readDir(readDir, options).filter((t) => t.split(".").length === 1).includes(targetDir);
39
+ }
40
+ rmFile(filePath, options = {
41
+ force: true,
42
+ maxRetries: 0,
43
+ recursive: true,
44
+ retryDelay: 100
45
+ }) {
46
+ if (this.exists(filePath)) {
47
+ if (this.isRootPathTargeted(filePath)) fsSync.rmSync(resolve(join(this.cwd, filePath)), options);
48
+ else fsSync.rmSync(resolve(this.cwd, filePath), options);
49
+ } else return;
50
+ }
51
+ /**
52
+ * Removes files and directories (modeled on the standard POSIX `rm` utility).
53
+ * To get a behavior similar to the `rm -rf` Unix command, use options `{ recursive: true, force: true }`.
54
+ * @return Fulfills with `undefined` upon success.
55
+ */
56
+ async rmdir(dir, options = {
57
+ maxRetries: 0,
58
+ retryDelay: 100,
59
+ recursive: true,
60
+ force: true
61
+ }) {
62
+ const resolved = relative(this.cwd, dir);
63
+ if (this.exists(dir)) return await fsAsync.rm(relative(this.cwd, dir), options);
64
+ else throw new Error(`directory ${resolved} does not exist`);
65
+ }
66
+ rmDirSync(dir, options = {
67
+ force: true,
68
+ recursive: true,
69
+ maxRetries: 0,
70
+ retryDelay: 100
71
+ }, callback = (err) => err?.message ? console.error(err.message) : console.error(`directory ${dir} does not exist`)) {
72
+ const resolved = resolve(this.cwd, dir);
73
+ if (this.exists(dir)) return fsSync.rm(resolved, options, callback);
74
+ else throw new Error(`directory ${resolved} does not exist`);
75
+ }
76
+ existsTmp(path) {
77
+ return this.exists(resolve(this.tmpDir, path));
78
+ }
79
+ mkdirTmp(path, options = {
80
+ mode: 511,
81
+ recursive: true
82
+ }) {
83
+ return this.mkdirSync(resolve(this.tmpDir, path), options);
84
+ }
85
+ generateDirIfDNETmp(path, options) {
86
+ if (this.existsTmp(path)) return;
87
+ else return this.mkdirTmp(path, options);
88
+ }
89
+ rmTmpFile(filename) {
90
+ const tmpPath = resolve(this.tmpDir, filename);
91
+ this.rmFile(tmpPath);
92
+ }
14
93
  };
94
+ export { FsAtomic };
95
+
15
96
  //# sourceMappingURL=index.js.map
@@ -1,114 +1,106 @@
1
- import { Readable } from 'node:stream';
2
- import { ReadableStream } from 'stream/web';
3
- import expand from 'dotenv-expand';
4
- import { ReadDirOptions } from '../types/index.js';
5
- import { AsyncIter, Streamable } from '../types/stream.js';
6
- import { ImageService } from '../image/index.js';
7
- import 'stream';
8
- import 'fs';
9
- import '@d0paminedriven/metadata';
10
- import '../image/workup.js';
11
- import '../mime/index.js';
12
- import '../url/index.js';
13
- import '../utils/index.js';
14
- import '../ld/index.js';
15
-
16
- declare class FsBase extends ImageService {
17
- cwd: string;
18
- constructor(cwd: string);
19
- get tmpDir(): string;
20
- get homeDir(): string;
21
- get platform(): NodeJS.Platform;
22
- get hostname(): string;
23
- get devNull(): string;
24
- get eol(): string;
25
- private get env();
26
- parseDotEnv(): expand.DotenvParseOutput | undefined;
27
- relative(from: string, to: string): string;
28
- isHomeTargeted(path: string): boolean;
29
- isRootPathTargeted<const T extends string>(path: T): boolean;
30
- pathHandler<const T extends string>(path: T): string;
31
- isUint8Array(v: unknown): v is Uint8Array<ArrayBufferLike>;
32
- isBuffer(v: unknown): v is Buffer<ArrayBufferLike>;
33
- isWebReadableStream(v: unknown): v is ReadableStream<any>;
34
- isAsyncIterable(v: unknown): v is AsyncIter;
35
- formatHelper<const T extends string>(f: T): string;
36
- cleanDataUrl<const C extends string>(props: C): string;
37
- toReadable(data: Streamable): Readable;
38
- /**
39
- *
40
- * @param target path to the file or directory to check for existence
41
- * @returns true if the file or directory exists, false otherwise
42
- * @example
43
- * ```ts
44
- * const fs = new Fs(process.cwd());
45
- * const exists = fs.exists("my-file.txt");
46
- * console.log(exists); // true if the file exists, false otherwise
47
- * ```
48
- * @description
49
- * This method checks if a file or directory exists at the specified path input
50
- *
51
- * Additional Note:
52
- *
53
- * say you have a directory that begins with a dot, such as `.turbo`;
54
- *
55
- * in this scenario, both `./.turbo` and `.turbo` will return true if the directory exists
56
- *
57
- */
58
- exists<const T extends string>(target: T): boolean;
59
- /**
60
- *
61
- * @param ms milliseconds to wait
62
- * @returns a promise that resolves after the specified number of milliseconds
63
- * @example
64
- * ```ts
65
- * const fs = new Fs(process.cwd());
66
- * await fs.wait(1000); // waits for 1 second
67
- * console.log("Done waiting!");
68
- * ```
69
- *
70
- * Alternatively, you can use it like this:
71
- * ```ts
72
- * const fs = new Fs(process.cwd());
73
- * fs.wait(1000).then(() => { // waits for 1 second
74
- * console.log("Done waiting!");
75
- * // do something after waiting
76
- * });
77
- * ```
78
- *
79
- * @description
80
- * This method is useful for delaying execution in asynchronous code, such as when you need to wait for a file operation to complete or when you want to introduce a delay in a loop.
81
- */
82
- wait<T extends number>(ms: T): Promise<unknown>;
83
- /**
84
- * Handles an array or readonly array of strings and/or Buffers, converting Buffers to strings
85
- * @param arr An array or readonly array of strings and/or Buffers
86
- * @returns An array of strings with Buffers converted to UTF-8 strings.
87
- */
88
- handleBuffStrArrUnion<const T extends (string | Buffer)[] | readonly (string | Buffer)[]>(arr: T): string[];
89
- /**
90
- *
91
- * @param path path to the directory relative to the cwd
92
- * @param options options for reading the directory, defaults to recursive
93
- *
94
- * The following two examples are equivalent:
95
- *
96
- * @example
97
- * ```ts
98
- * const fs = new Fs(process.cwd());
99
- * const files = fs.readDir("./my-directory", { recursive: true });
100
- * console.log(files);
101
- * ```
102
- * @example
103
- * ```ts
104
- * const fs = new Fs(process.cwd());
105
- * const files = fs.readDir("my-directory", { recursive: true });
106
- * console.log(files);
107
- * ```
108
- *
109
- * @returns an array of strings representing the contents of the directory
110
- */
111
- readDir<const T extends string>(path: T, options?: ReadDirOptions): string[];
1
+ import { Readable } from "node:stream";
2
+ import { ReadableStream } from "node:stream/web";
3
+ import expand from "dotenv-expand";
4
+ import { ReadDirOptions } from "../types/index.js";
5
+ import { AsyncIter, Streamable } from "../types/stream.js";
6
+ import { MimeService } from "../mime/index.js";
7
+ export declare class FsBase extends MimeService {
8
+ cwd: string;
9
+ constructor(cwd: string);
10
+ get tmpDir(): string;
11
+ get homedir(): string;
12
+ get platform(): NodeJS.Platform;
13
+ get hostname(): string;
14
+ get machine(): string;
15
+ get devNull(): string;
16
+ get eol(): string;
17
+ private get env();
18
+ relPath<const T extends string>(path: T): string;
19
+ absPath<const T extends string>(path: T): string;
20
+ parseDotEnv(): expand.DotenvParseOutput | undefined;
21
+ isHomeTargeted(path: string): boolean;
22
+ isRootPathTargeted<const T extends string>(path: T): boolean;
23
+ pathHandler<const T extends string>(path: T): string;
24
+ isUint8Array(v: unknown): v is Uint8Array<ArrayBufferLike>;
25
+ isBuffer(v: unknown): v is Buffer<ArrayBufferLike>;
26
+ isWebReadableStream(v: unknown): v is ReadableStream<any>;
27
+ isAsyncIterable(v: unknown): v is AsyncIter;
28
+ formatHelper<const T extends string>(f: T): string;
29
+ cleanDataUrl<const C extends string>(props: C): string;
30
+ toReadable(data: Streamable): Readable;
31
+ /**
32
+ *
33
+ * @param target path to the file or directory to check for existence
34
+ * @returns true if the file or directory exists, false otherwise
35
+ * @example
36
+ * ```ts
37
+ * const fs = new Fs(process.cwd());
38
+ * const exists = fs.exists("my-file.txt");
39
+ * console.log(exists); // true if the file exists, false otherwise
40
+ * ```
41
+ * @description
42
+ * This method checks if a file or directory exists at the specified path input
43
+ *
44
+ * Additional Note:
45
+ *
46
+ * say you have a directory that begins with a dot, such as `.turbo`;
47
+ *
48
+ * in this scenario, both `./.turbo` and `.turbo` will return true if the directory exists
49
+ *
50
+ */
51
+ exists<const T extends string>(target: T): boolean;
52
+ /**
53
+ *
54
+ * @param ms milliseconds to wait
55
+ * @returns a promise that resolves after the specified number of milliseconds
56
+ * @example
57
+ * ```ts
58
+ * const fs = new Fs(process.cwd());
59
+ * await fs.wait(1000); // waits for 1 second
60
+ * console.log("Done waiting!");
61
+ * ```
62
+ *
63
+ * Alternatively, you can use it like this:
64
+ * ```ts
65
+ * const fs = new Fs(process.cwd());
66
+ * fs.wait(1000).then(() => { // waits for 1 second
67
+ * console.log("Done waiting!");
68
+ * // do something after waiting
69
+ * });
70
+ * ```
71
+ *
72
+ * @description
73
+ * This method is useful for delaying execution in asynchronous code, such as when you need to wait for a file operation to complete or when you want to introduce a delay in a loop.
74
+ */
75
+ wait<T extends number>(ms: T): Promise<unknown>;
76
+ /**
77
+ * Handles an array or readonly array of strings and/or Buffers, converting Buffers to strings
78
+ * @param arr An array or readonly array of strings and/or Buffers
79
+ * @returns An array of strings with Buffers converted to UTF-8 strings.
80
+ */
81
+ handleBuffStrArrUnion<const T extends (string | Buffer)[] | readonly (string | Buffer)[]>(arr: T): string[];
82
+ /**
83
+ *
84
+ * @param path path to the directory relative to the cwd
85
+ * @param options options for reading the directory, defaults to recursive
86
+ *
87
+ * The following two examples are equivalent:
88
+ *
89
+ * @example
90
+ * ```ts
91
+ * const fs = new Fs(process.cwd());
92
+ * const files = fs.readDir("./my-directory", { recursive: true });
93
+ * console.log(files);
94
+ * ```
95
+ * @example
96
+ * ```ts
97
+ * const fs = new Fs(process.cwd());
98
+ * const files = fs.readDir("my-directory", { recursive: true });
99
+ * console.log(files);
100
+ * ```
101
+ *
102
+ * @returns an array of strings representing the contents of the directory
103
+ */
104
+ readDir<const T extends string>(path: T, options?: ReadDirOptions): string[];
112
105
  }
113
-
114
- export { FsBase };
106
+ //# sourceMappingURL=index.d.ts.map