@robinpath/fs 0.1.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 ADDED
@@ -0,0 +1,97 @@
1
+ # @robinpath/fs
2
+
3
+ > Read, write, copy, move, and manage files and directories
4
+
5
+ ![Category](https://img.shields.io/badge/category-Utility-blue) ![Functions](https://img.shields.io/badge/functions-14-green) ![Auth](https://img.shields.io/badge/auth-none-lightgrey) ![License](https://img.shields.io/badge/license-MIT-brightgreen)
6
+
7
+ ## Why use this module?
8
+
9
+ The `fs` module lets you:
10
+
11
+ - Read the contents of a file as a string
12
+ - Write content to a file, creating or overwriting it
13
+ - Append content to the end of a file
14
+ - Check whether a file or directory exists at the given path
15
+ - Delete a file
16
+
17
+ All functions are callable directly from RobinPath scripts with a simple, consistent API.
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ npm install @robinpath/fs
23
+ ```
24
+
25
+ ## Quick Start
26
+
27
+ No credentials needed — start using it right away:
28
+
29
+ ```robinpath
30
+ any "/tmp/file.txt" "hello world"
31
+ ```
32
+
33
+ ## Available Functions
34
+
35
+ | Function | Description |
36
+ |----------|-------------|
37
+ | `fs.read` | Read the contents of a file as a string |
38
+ | `fs.write` | Write content to a file, creating or overwriting it |
39
+ | `fs.append` | Append content to the end of a file |
40
+ | `fs.exists` | Check whether a file or directory exists at the given path |
41
+ | `fs.delete` | Delete a file |
42
+ | `fs.copy` | Copy a file from source to destination |
43
+ | `fs.move` | Move or rename a file from source to destination |
44
+ | `fs.rename` | Rename a file (alias for move) |
45
+ | `fs.list` | List the contents of a directory |
46
+ | `fs.mkdir` | Create a directory (recursively creates parent directories) |
47
+ | `fs.rmdir` | Remove a directory and its contents |
48
+ | `fs.stat` | Get file or directory statistics |
49
+ | `fs.isFile` | Check whether a path points to a regular file |
50
+ | `fs.isDir` | Check whether a path points to a directory |
51
+
52
+ ## Examples
53
+
54
+ ### Write content to a file, creating or overwriting it
55
+
56
+ ```robinpath
57
+ any "/tmp/file.txt" "hello world"
58
+ ```
59
+
60
+ ### Append content to the end of a file
61
+
62
+ ```robinpath
63
+ any "/tmp/file.txt" "more text"
64
+ ```
65
+
66
+ ### Check whether a file or directory exists at the given path
67
+
68
+ ```robinpath
69
+ any "/tmp/file.txt"
70
+ ```
71
+
72
+ ## Integration with RobinPath
73
+
74
+ ```typescript
75
+ import { RobinPath } from "@wiredwp/robinpath";
76
+ import Module from "@robinpath/fs";
77
+
78
+ const rp = new RobinPath();
79
+ rp.registerModule(Module.name, Module.functions);
80
+ rp.registerModuleMeta(Module.name, Module.functionMetadata);
81
+
82
+ const result = await rp.executeScript(`
83
+ any "/tmp/file.txt" "hello world"
84
+ `);
85
+ ```
86
+
87
+ ## Full API Reference
88
+
89
+ See [MODULE.md](./MODULE.md) for complete documentation including all parameters, return types, error handling, and advanced examples.
90
+
91
+ ## Related Modules
92
+
93
+ - [`@robinpath/json`](../json) — JSON module for complementary functionality
94
+
95
+ ## License
96
+
97
+ MIT
package/dist/fs.d.ts ADDED
@@ -0,0 +1,199 @@
1
+ import type { BuiltinHandler } from "@wiredwp/robinpath";
2
+ export declare const FsFunctions: Record<string, BuiltinHandler>;
3
+ export declare const FsFunctionMetadata: {
4
+ read: {
5
+ description: string;
6
+ parameters: ({
7
+ name: string;
8
+ dataType: string;
9
+ description: string;
10
+ formInputType: string;
11
+ required: boolean;
12
+ defaultValue?: undefined;
13
+ } | {
14
+ name: string;
15
+ dataType: string;
16
+ description: string;
17
+ formInputType: string;
18
+ required: boolean;
19
+ defaultValue: string;
20
+ })[];
21
+ returnType: string;
22
+ returnDescription: string;
23
+ example: string;
24
+ };
25
+ write: {
26
+ description: string;
27
+ parameters: {
28
+ name: string;
29
+ dataType: string;
30
+ description: string;
31
+ formInputType: string;
32
+ required: boolean;
33
+ }[];
34
+ returnType: string;
35
+ returnDescription: string;
36
+ example: string;
37
+ };
38
+ append: {
39
+ description: string;
40
+ parameters: {
41
+ name: string;
42
+ dataType: string;
43
+ description: string;
44
+ formInputType: string;
45
+ required: boolean;
46
+ }[];
47
+ returnType: string;
48
+ returnDescription: string;
49
+ example: string;
50
+ };
51
+ exists: {
52
+ description: string;
53
+ parameters: {
54
+ name: string;
55
+ dataType: string;
56
+ description: string;
57
+ formInputType: string;
58
+ required: boolean;
59
+ }[];
60
+ returnType: string;
61
+ returnDescription: string;
62
+ example: string;
63
+ };
64
+ delete: {
65
+ description: string;
66
+ parameters: {
67
+ name: string;
68
+ dataType: string;
69
+ description: string;
70
+ formInputType: string;
71
+ required: boolean;
72
+ }[];
73
+ returnType: string;
74
+ returnDescription: string;
75
+ example: string;
76
+ };
77
+ copy: {
78
+ description: string;
79
+ parameters: {
80
+ name: string;
81
+ dataType: string;
82
+ description: string;
83
+ formInputType: string;
84
+ required: boolean;
85
+ }[];
86
+ returnType: string;
87
+ returnDescription: string;
88
+ example: string;
89
+ };
90
+ move: {
91
+ description: string;
92
+ parameters: {
93
+ name: string;
94
+ dataType: string;
95
+ description: string;
96
+ formInputType: string;
97
+ required: boolean;
98
+ }[];
99
+ returnType: string;
100
+ returnDescription: string;
101
+ example: string;
102
+ };
103
+ rename: {
104
+ description: string;
105
+ parameters: {
106
+ name: string;
107
+ dataType: string;
108
+ description: string;
109
+ formInputType: string;
110
+ required: boolean;
111
+ }[];
112
+ returnType: string;
113
+ returnDescription: string;
114
+ example: string;
115
+ };
116
+ list: {
117
+ description: string;
118
+ parameters: {
119
+ name: string;
120
+ dataType: string;
121
+ description: string;
122
+ formInputType: string;
123
+ required: boolean;
124
+ }[];
125
+ returnType: string;
126
+ returnDescription: string;
127
+ example: string;
128
+ };
129
+ mkdir: {
130
+ description: string;
131
+ parameters: {
132
+ name: string;
133
+ dataType: string;
134
+ description: string;
135
+ formInputType: string;
136
+ required: boolean;
137
+ }[];
138
+ returnType: string;
139
+ returnDescription: string;
140
+ example: string;
141
+ };
142
+ rmdir: {
143
+ description: string;
144
+ parameters: {
145
+ name: string;
146
+ dataType: string;
147
+ description: string;
148
+ formInputType: string;
149
+ required: boolean;
150
+ }[];
151
+ returnType: string;
152
+ returnDescription: string;
153
+ example: string;
154
+ };
155
+ stat: {
156
+ description: string;
157
+ parameters: {
158
+ name: string;
159
+ dataType: string;
160
+ description: string;
161
+ formInputType: string;
162
+ required: boolean;
163
+ }[];
164
+ returnType: string;
165
+ returnDescription: string;
166
+ example: string;
167
+ };
168
+ isFile: {
169
+ description: string;
170
+ parameters: {
171
+ name: string;
172
+ dataType: string;
173
+ description: string;
174
+ formInputType: string;
175
+ required: boolean;
176
+ }[];
177
+ returnType: string;
178
+ returnDescription: string;
179
+ example: string;
180
+ };
181
+ isDir: {
182
+ description: string;
183
+ parameters: {
184
+ name: string;
185
+ dataType: string;
186
+ description: string;
187
+ formInputType: string;
188
+ required: boolean;
189
+ }[];
190
+ returnType: string;
191
+ returnDescription: string;
192
+ example: string;
193
+ };
194
+ };
195
+ export declare const FsModuleMetadata: {
196
+ description: string;
197
+ methods: string[];
198
+ };
199
+ //# sourceMappingURL=fs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAoC,MAAM,oBAAoB,CAAC;AAmH3F,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAetD,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8P9B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;CAkB5B,CAAC"}
package/dist/fs.js ADDED
@@ -0,0 +1,389 @@
1
+ // -- RobinPath Function Handlers ----------------------------------------
2
+ const read = async (args) => {
3
+ const filePath = String(args[0] ?? "");
4
+ const encoding = (args[1] != null ? String(args[1]) : "utf-8");
5
+ return await any(filePath, { encoding });
6
+ };
7
+ const write = async (args) => {
8
+ const filePath = String(args[0] ?? "");
9
+ const content = String(args[1] ?? "");
10
+ await any(filePath, content, "utf-8");
11
+ return true;
12
+ };
13
+ const append = async (args) => {
14
+ const filePath = String(args[0] ?? "");
15
+ const content = String(args[1] ?? "");
16
+ await any(filePath, content, "utf-8");
17
+ return true;
18
+ };
19
+ const exists = async (args) => {
20
+ const filePath = String(args[0] ?? "");
21
+ try {
22
+ await any(filePath, any.F_OK);
23
+ return true;
24
+ }
25
+ catch {
26
+ return false;
27
+ }
28
+ };
29
+ const del = async (args) => {
30
+ const filePath = String(args[0] ?? "");
31
+ await any(filePath);
32
+ return true;
33
+ };
34
+ const copy = async (args) => {
35
+ const src = String(args[0] ?? "");
36
+ const dest = String(args[1] ?? "");
37
+ await any(src, dest);
38
+ return true;
39
+ };
40
+ const move = async (args) => {
41
+ const src = String(args[0] ?? "");
42
+ const dest = String(args[1] ?? "");
43
+ await any(src, dest);
44
+ return true;
45
+ };
46
+ const rename = async (args) => {
47
+ const oldPath = String(args[0] ?? "");
48
+ const newPath = String(args[1] ?? "");
49
+ await any(oldPath, newPath);
50
+ return true;
51
+ };
52
+ const list = async (args) => {
53
+ const dirPath = String(args[0] ?? "");
54
+ const entries = await any(dirPath);
55
+ return entries;
56
+ };
57
+ const mkdir = async (args) => {
58
+ const dirPath = String(args[0] ?? "");
59
+ await any(dirPath, { recursive: true });
60
+ return true;
61
+ };
62
+ const rmdir = async (args) => {
63
+ const dirPath = String(args[0] ?? "");
64
+ await any(dirPath, { recursive: true });
65
+ return true;
66
+ };
67
+ const stat = async (args) => {
68
+ const filePath = String(args[0] ?? "");
69
+ const stats = await any(filePath);
70
+ return {
71
+ size: stats.size,
72
+ isFile: stats.isFile(),
73
+ isDirectory: stats.isDirectory(),
74
+ created: stats.birthtime.toISOString(),
75
+ modified: stats.mtime.toISOString(),
76
+ };
77
+ };
78
+ const isFile = async (args) => {
79
+ const filePath = String(args[0] ?? "");
80
+ try {
81
+ const stats = await any(filePath);
82
+ return stats.isFile();
83
+ }
84
+ catch {
85
+ return false;
86
+ }
87
+ };
88
+ const isDir = async (args) => {
89
+ const filePath = String(args[0] ?? "");
90
+ try {
91
+ const stats = await any(filePath);
92
+ return stats.isDirectory();
93
+ }
94
+ catch {
95
+ return false;
96
+ }
97
+ };
98
+ // -- Exports ------------------------------------------------------------
99
+ export const FsFunctions = {
100
+ read,
101
+ write,
102
+ append,
103
+ exists,
104
+ delete: del,
105
+ copy,
106
+ move,
107
+ rename,
108
+ list,
109
+ mkdir,
110
+ rmdir,
111
+ stat,
112
+ isFile,
113
+ isDir,
114
+ };
115
+ export const FsFunctionMetadata = {
116
+ read: {
117
+ description: "Read the contents of a file as a string",
118
+ parameters: [
119
+ {
120
+ name: "path",
121
+ dataType: "string",
122
+ description: "Absolute or relative path to the file",
123
+ formInputType: "text",
124
+ required: true,
125
+ },
126
+ {
127
+ name: "encoding",
128
+ dataType: "string",
129
+ description: "Character encoding (default: utf-8)",
130
+ formInputType: "text",
131
+ required: false,
132
+ defaultValue: "utf-8",
133
+ },
134
+ ],
135
+ returnType: "string",
136
+ returnDescription: "The file contents as a string",
137
+ example: 'any "/tmp/file.txt"',
138
+ },
139
+ write: {
140
+ description: "Write content to a file, creating or overwriting it",
141
+ parameters: [
142
+ {
143
+ name: "path",
144
+ dataType: "string",
145
+ description: "Absolute or relative path to the file",
146
+ formInputType: "text",
147
+ required: true,
148
+ },
149
+ {
150
+ name: "content",
151
+ dataType: "string",
152
+ description: "The content to write",
153
+ formInputType: "textarea",
154
+ required: true,
155
+ },
156
+ ],
157
+ returnType: "boolean",
158
+ returnDescription: "True if the write succeeded",
159
+ example: 'any "/tmp/file.txt" "hello world"',
160
+ },
161
+ append: {
162
+ description: "Append content to the end of a file",
163
+ parameters: [
164
+ {
165
+ name: "path",
166
+ dataType: "string",
167
+ description: "Absolute or relative path to the file",
168
+ formInputType: "text",
169
+ required: true,
170
+ },
171
+ {
172
+ name: "content",
173
+ dataType: "string",
174
+ description: "The content to append",
175
+ formInputType: "textarea",
176
+ required: true,
177
+ },
178
+ ],
179
+ returnType: "boolean",
180
+ returnDescription: "True if the append succeeded",
181
+ example: 'any "/tmp/file.txt" "more text"',
182
+ },
183
+ exists: {
184
+ description: "Check whether a file or directory exists at the given path",
185
+ parameters: [
186
+ {
187
+ name: "path",
188
+ dataType: "string",
189
+ description: "Absolute or relative path to check",
190
+ formInputType: "text",
191
+ required: true,
192
+ },
193
+ ],
194
+ returnType: "boolean",
195
+ returnDescription: "True if the path exists, false otherwise",
196
+ example: 'any "/tmp/file.txt"',
197
+ },
198
+ delete: {
199
+ description: "Delete a file",
200
+ parameters: [
201
+ {
202
+ name: "path",
203
+ dataType: "string",
204
+ description: "Absolute or relative path to the file to delete",
205
+ formInputType: "text",
206
+ required: true,
207
+ },
208
+ ],
209
+ returnType: "boolean",
210
+ returnDescription: "True if the file was deleted",
211
+ example: 'any "/tmp/file.txt"',
212
+ },
213
+ copy: {
214
+ description: "Copy a file from source to destination",
215
+ parameters: [
216
+ {
217
+ name: "src",
218
+ dataType: "string",
219
+ description: "Path to the source file",
220
+ formInputType: "text",
221
+ required: true,
222
+ },
223
+ {
224
+ name: "dest",
225
+ dataType: "string",
226
+ description: "Path to the destination file",
227
+ formInputType: "text",
228
+ required: true,
229
+ },
230
+ ],
231
+ returnType: "boolean",
232
+ returnDescription: "True if the copy succeeded",
233
+ example: 'any "/tmp/a.txt" "/tmp/b.txt"',
234
+ },
235
+ move: {
236
+ description: "Move or rename a file from source to destination",
237
+ parameters: [
238
+ {
239
+ name: "src",
240
+ dataType: "string",
241
+ description: "Path to the source file",
242
+ formInputType: "text",
243
+ required: true,
244
+ },
245
+ {
246
+ name: "dest",
247
+ dataType: "string",
248
+ description: "Path to the destination file",
249
+ formInputType: "text",
250
+ required: true,
251
+ },
252
+ ],
253
+ returnType: "boolean",
254
+ returnDescription: "True if the move succeeded",
255
+ example: 'any "/tmp/old.txt" "/tmp/new.txt"',
256
+ },
257
+ rename: {
258
+ description: "Rename a file (alias for move)",
259
+ parameters: [
260
+ {
261
+ name: "oldPath",
262
+ dataType: "string",
263
+ description: "Current file path",
264
+ formInputType: "text",
265
+ required: true,
266
+ },
267
+ {
268
+ name: "newPath",
269
+ dataType: "string",
270
+ description: "New file path",
271
+ formInputType: "text",
272
+ required: true,
273
+ },
274
+ ],
275
+ returnType: "boolean",
276
+ returnDescription: "True if the rename succeeded",
277
+ example: 'any "/tmp/old.txt" "/tmp/new.txt"',
278
+ },
279
+ list: {
280
+ description: "List the contents of a directory",
281
+ parameters: [
282
+ {
283
+ name: "dir",
284
+ dataType: "string",
285
+ description: "Path to the directory to list",
286
+ formInputType: "text",
287
+ required: true,
288
+ },
289
+ ],
290
+ returnType: "array",
291
+ returnDescription: "Array of filenames in the directory",
292
+ example: 'any "/tmp"',
293
+ },
294
+ mkdir: {
295
+ description: "Create a directory (recursively creates parent directories)",
296
+ parameters: [
297
+ {
298
+ name: "path",
299
+ dataType: "string",
300
+ description: "Path of the directory to create",
301
+ formInputType: "text",
302
+ required: true,
303
+ },
304
+ ],
305
+ returnType: "boolean",
306
+ returnDescription: "True if the directory was created",
307
+ example: 'any "/tmp/my/nested/dir"',
308
+ },
309
+ rmdir: {
310
+ description: "Remove a directory and its contents",
311
+ parameters: [
312
+ {
313
+ name: "path",
314
+ dataType: "string",
315
+ description: "Path of the directory to remove",
316
+ formInputType: "text",
317
+ required: true,
318
+ },
319
+ ],
320
+ returnType: "boolean",
321
+ returnDescription: "True if the directory was removed",
322
+ example: 'any "/tmp/my/dir"',
323
+ },
324
+ stat: {
325
+ description: "Get file or directory statistics",
326
+ parameters: [
327
+ {
328
+ name: "path",
329
+ dataType: "string",
330
+ description: "Path to the file or directory",
331
+ formInputType: "text",
332
+ required: true,
333
+ },
334
+ ],
335
+ returnType: "object",
336
+ returnDescription: "Object with size, isFile, isDirectory, created, and modified properties",
337
+ example: 'any "/tmp/file.txt"',
338
+ },
339
+ isFile: {
340
+ description: "Check whether a path points to a regular file",
341
+ parameters: [
342
+ {
343
+ name: "path",
344
+ dataType: "string",
345
+ description: "Path to check",
346
+ formInputType: "text",
347
+ required: true,
348
+ },
349
+ ],
350
+ returnType: "boolean",
351
+ returnDescription: "True if the path is a regular file, false otherwise",
352
+ example: 'any "/tmp/file.txt"',
353
+ },
354
+ isDir: {
355
+ description: "Check whether a path points to a directory",
356
+ parameters: [
357
+ {
358
+ name: "path",
359
+ dataType: "string",
360
+ description: "Path to check",
361
+ formInputType: "text",
362
+ required: true,
363
+ },
364
+ ],
365
+ returnType: "boolean",
366
+ returnDescription: "True if the path is a directory, false otherwise",
367
+ example: 'any "/tmp"',
368
+ },
369
+ };
370
+ export const FsModuleMetadata = {
371
+ description: "Read, write, copy, move, and manage files and directories",
372
+ methods: [
373
+ "read",
374
+ "write",
375
+ "append",
376
+ "exists",
377
+ "delete",
378
+ "copy",
379
+ "move",
380
+ "rename",
381
+ "list",
382
+ "mkdir",
383
+ "rmdir",
384
+ "stat",
385
+ "isFile",
386
+ "isDir",
387
+ ],
388
+ };
389
+ //# sourceMappingURL=fs.js.map
package/dist/fs.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.js","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":"AAKA,0EAA0E;AAE1E,MAAM,IAAI,GAAmB,KAAK,EAAE,IAAI,EAAE,EAAE;IAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACvC,MAAM,QAAQ,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAmB,CAAC;IACjF,OAAO,MAAM,GA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M;gBACZ,QAAQ,EAAE,QAAQ;gBAClB,WAAW,EAAE,+BAA+B;gBAC5C,aAAa,EAAE,MAAM;gBACrB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,UAAU,EAAE,QAAQ;QACpB,iBAAiB,EAAE,yEAAyE;QAC5F,OAAO,EAAE,qBAAqB;KAC/B;IACD,MAAM,EAAE;QACN,WAAW,EAAE,+CAA+C;QAC5D,UAAU,EAAE;YACV;gBACE,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,QAAQ;gBAClB,WAAW,EAAE,eAAe;gBAC5B,aAAa,EAAE,MAAM;gBACrB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,UAAU,EAAE,SAAS;QACrB,iBAAiB,EAAE,qDAAqD;QACxE,OAAO,EAAE,qBAAqB;KAC/B;IACD,KAAK,EAAE;QACL,WAAW,EAAE,4CAA4C;QACzD,UAAU,EAAE;YACV;gBACE,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,QAAQ;gBAClB,WAAW,EAAE,eAAe;gBAC5B,aAAa,EAAE,MAAM;gBACrB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,UAAU,EAAE,SAAS;QACrB,iBAAiB,EAAE,kDAAkD;QACrE,OAAO,EAAE,YAAY;KACtB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,WAAW,EAAE,2DAA2D;IACxE,OAAO,EAAE;QACP,MAAM;QACN,OAAO;QACP,QAAQ;QACR,QAAQ;QACR,QAAQ;QACR,MAAM;QACN,MAAM;QACN,QAAQ;QACR,MAAM;QACN,OAAO;QACP,OAAO;QACP,MAAM;QACN,QAAQ;QACR,OAAO;KACR;CACF,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ModuleAdapter } from "@wiredwp/robinpath";
2
+ declare const FsModule: ModuleAdapter;
3
+ export default FsModule;
4
+ export { FsModule };
5
+ export { FsFunctions, FsFunctionMetadata, FsModuleMetadata } from "./fs.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,QAAA,MAAM,QAAQ,EAAE,aAMf,CAAC;AAEF,eAAe,QAAQ,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ import { FsFunctions, FsFunctionMetadata, FsModuleMetadata } from "./fs.js";
2
+ const FsModule = {
3
+ name: "fs",
4
+ functions: FsFunctions,
5
+ functionMetadata: FsFunctionMetadata,
6
+ moduleMetadata: FsModuleMetadata,
7
+ global: false,
8
+ }; // as ModuleAdapter
9
+ export default FsModule;
10
+ export { FsModule };
11
+ export { FsFunctions, FsFunctionMetadata, FsModuleMetadata } from "./fs.js";
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE5E,MAAM,QAAQ,GAAkB;IAC9B,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,WAAW;IACtB,gBAAgB,EAAE,kBAAyB;IAC3C,cAAc,EAAE,gBAAuB;IACvC,MAAM,EAAE,KAAK;CACd,CAAC,CAAC,mBAAmB;AAEtB,eAAe,QAAQ,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@robinpath/fs",
3
+ "version": "0.1.0",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "type": "module",
8
+ "main": "dist/index.js",
9
+ "types": "dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./dist/index.js",
13
+ "types": "./dist/index.d.ts"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc",
21
+ "test": "node --import tsx --test tests/*.test.ts"
22
+ },
23
+ "peerDependencies": {
24
+ "@wiredwp/robinpath": ">=0.20.0"
25
+ },
26
+ "devDependencies": {
27
+ "@wiredwp/robinpath": "^0.30.1",
28
+ "tsx": "^4.19.0",
29
+ "typescript": "^5.6.0"
30
+ }
31
+ }