@gjsify/fs 0.4.0 → 0.4.4

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 (50) hide show
  1. package/package.json +51 -48
  2. package/src/callback.spec.ts +0 -296
  3. package/src/callback.ts +0 -684
  4. package/src/cp.spec.ts +0 -181
  5. package/src/cp.ts +0 -328
  6. package/src/dir.spec.ts +0 -204
  7. package/src/dir.ts +0 -199
  8. package/src/dirent.ts +0 -165
  9. package/src/encoding.ts +0 -45
  10. package/src/errors.spec.ts +0 -389
  11. package/src/errors.ts +0 -19
  12. package/src/extended.spec.ts +0 -706
  13. package/src/fd-ops.spec.ts +0 -234
  14. package/src/fd-ops.ts +0 -251
  15. package/src/file-handle.spec.ts +0 -115
  16. package/src/file-handle.ts +0 -856
  17. package/src/fs-watcher.ts +0 -198
  18. package/src/glob.spec.ts +0 -201
  19. package/src/glob.ts +0 -205
  20. package/src/index.ts +0 -313
  21. package/src/new-apis.spec.ts +0 -505
  22. package/src/promises.spec.ts +0 -812
  23. package/src/promises.ts +0 -686
  24. package/src/read-stream.ts +0 -128
  25. package/src/stat-watcher.ts +0 -116
  26. package/src/stat.spec.ts +0 -87
  27. package/src/statfs.spec.ts +0 -67
  28. package/src/statfs.ts +0 -92
  29. package/src/stats.ts +0 -207
  30. package/src/streams.spec.ts +0 -513
  31. package/src/symlink.spec.ts +0 -188
  32. package/src/sync.spec.ts +0 -377
  33. package/src/sync.ts +0 -568
  34. package/src/test.mts +0 -27
  35. package/src/types/encoding-option.ts +0 -3
  36. package/src/types/file-read-options.ts +0 -15
  37. package/src/types/file-read-result.ts +0 -4
  38. package/src/types/flag-and-open-mode.ts +0 -6
  39. package/src/types/index.ts +0 -6
  40. package/src/types/open-flags.ts +0 -14
  41. package/src/types/read-options.ts +0 -9
  42. package/src/utils.ts +0 -31
  43. package/src/utimes.spec.ts +0 -113
  44. package/src/utimes.ts +0 -97
  45. package/src/watch.spec.ts +0 -171
  46. package/src/watchfile.spec.ts +0 -185
  47. package/src/write-stream.ts +0 -142
  48. package/test/file.txt +0 -1
  49. package/tsconfig.json +0 -29
  50. package/tsconfig.tsbuildinfo +0 -1
package/src/index.ts DELETED
@@ -1,313 +0,0 @@
1
- // Reference: Node.js lib/fs.js
2
- // Reimplemented for GJS using Gio.File
3
-
4
- import {
5
- existsSync,
6
- readdirSync,
7
- readFileSync,
8
- writeFileSync,
9
- mkdirSync,
10
- rmdirSync,
11
- unlinkSync,
12
- watch,
13
- mkdtempSync,
14
- rmSync,
15
- statSync,
16
- openSync,
17
- realpathSync,
18
- symlinkSync,
19
- lstatSync,
20
- renameSync,
21
- copyFileSync,
22
- accessSync,
23
- appendFileSync,
24
- readlinkSync,
25
- linkSync,
26
- truncateSync,
27
- chmodSync,
28
- chownSync,
29
- } from './sync.js';
30
- import {
31
- open,
32
- close,
33
- read,
34
- write,
35
- rm,
36
- realpath,
37
- readdir,
38
- symlink,
39
- lstat,
40
- stat,
41
- rename,
42
- copyFile,
43
- access,
44
- appendFile,
45
- readlink,
46
- truncate,
47
- chmod,
48
- chown,
49
- mkdir,
50
- rmdir,
51
- readFile,
52
- writeFile,
53
- unlink,
54
- link,
55
- } from './callback.js';
56
- import FSWatcher from './fs-watcher.js';
57
- import {
58
- createReadStream,
59
- ReadStream
60
- } from './read-stream.js';
61
- import {
62
- createWriteStream,
63
- WriteStream
64
- } from './write-stream.js';
65
- import * as promises from './promises.js';
66
- import { cpSync, cp } from './cp.js';
67
- import { Dir, opendir, opendirSync } from './dir.js';
68
- import { glob, globSync } from './glob.js';
69
- import { StatWatcher, watchFile, unwatchFile } from './stat-watcher.js';
70
- import { statfsSync, statfs } from './statfs.js';
71
- import { Stats, BigIntStats } from './stats.js';
72
- import { Dirent } from './dirent.js';
73
- import {
74
- utimesSync, utimes, lutimesSync, lutimes,
75
- lchownSync, lchown, lchmodSync, lchmod,
76
- } from './utimes.js';
77
- import {
78
- fstatSync, fstat,
79
- ftruncateSync, ftruncate,
80
- fdatasyncSync, fdatasync,
81
- fsyncSync, fsync,
82
- fchmodSync, fchmod,
83
- fchownSync, fchown,
84
- futimesSync, futimes,
85
- closeSync, readSync, writeSync,
86
- readvSync, readv,
87
- writevSync, writev,
88
- exists, openAsBlob,
89
- } from './fd-ops.js';
90
-
91
- // --- fs.constants ---
92
- export const constants = {
93
- // File access constants
94
- F_OK: 0,
95
- R_OK: 4,
96
- W_OK: 2,
97
- X_OK: 1,
98
- // File copy constants
99
- COPYFILE_EXCL: 1,
100
- COPYFILE_FICLONE: 2,
101
- COPYFILE_FICLONE_FORCE: 4,
102
- // File open constants
103
- O_RDONLY: 0,
104
- O_WRONLY: 1,
105
- O_RDWR: 2,
106
- O_CREAT: 64,
107
- O_EXCL: 128,
108
- O_TRUNC: 512,
109
- O_APPEND: 1024,
110
- O_SYNC: 1052672,
111
- O_NONBLOCK: 2048,
112
- O_DIRECTORY: 65536,
113
- O_NOFOLLOW: 131072,
114
- // File type constants
115
- S_IFMT: 61440,
116
- S_IFREG: 32768,
117
- S_IFDIR: 16384,
118
- S_IFCHR: 8192,
119
- S_IFBLK: 24576,
120
- S_IFIFO: 4096,
121
- S_IFLNK: 40960,
122
- S_IFSOCK: 49152,
123
- // File mode constants
124
- S_IRWXU: 448,
125
- S_IRUSR: 256,
126
- S_IWUSR: 128,
127
- S_IXUSR: 64,
128
- S_IRWXG: 56,
129
- S_IRGRP: 32,
130
- S_IWGRP: 16,
131
- S_IXGRP: 8,
132
- S_IRWXO: 7,
133
- S_IROTH: 4,
134
- S_IWOTH: 2,
135
- S_IXOTH: 1,
136
- };
137
-
138
- export {
139
- FSWatcher,
140
- StatWatcher,
141
- Stats,
142
- BigIntStats,
143
- Dirent,
144
- Dir,
145
- // Sync API
146
- existsSync,
147
- readdirSync,
148
- readFileSync,
149
- writeFileSync,
150
- mkdirSync,
151
- rmdirSync,
152
- unlinkSync,
153
- mkdtempSync,
154
- rmSync,
155
- statSync,
156
- openSync,
157
- realpathSync,
158
- symlinkSync,
159
- lstatSync,
160
- renameSync,
161
- copyFileSync,
162
- accessSync,
163
- appendFileSync,
164
- readlinkSync,
165
- linkSync,
166
- truncateSync,
167
- chmodSync,
168
- chownSync,
169
- cpSync,
170
- opendirSync,
171
- globSync,
172
- glob,
173
- watch,
174
- watchFile,
175
- unwatchFile,
176
- statfsSync,
177
- statfs,
178
- // utimes / lutimes / lchown / lchmod
179
- utimesSync, utimes, lutimesSync, lutimes,
180
- lchownSync, lchown, lchmodSync, lchmod,
181
- // fd-based ops
182
- fstatSync, fstat,
183
- ftruncateSync, ftruncate,
184
- fdatasyncSync, fdatasync,
185
- fsyncSync, fsync,
186
- fchmodSync, fchmod,
187
- fchownSync, fchown,
188
- futimesSync, futimes,
189
- closeSync, readSync, writeSync,
190
- readvSync, readv,
191
- writevSync, writev,
192
- exists, openAsBlob,
193
- // Streams
194
- createReadStream,
195
- ReadStream,
196
- createWriteStream,
197
- WriteStream,
198
- // Promises
199
- promises,
200
- // Callback API
201
- open,
202
- close,
203
- read,
204
- write,
205
- rm,
206
- realpath,
207
- readdir,
208
- symlink,
209
- lstat,
210
- stat,
211
- rename,
212
- copyFile,
213
- cp,
214
- access,
215
- appendFile,
216
- readlink,
217
- truncate,
218
- chmod,
219
- chown,
220
- mkdir,
221
- rmdir,
222
- readFile,
223
- writeFile,
224
- unlink,
225
- link,
226
- opendir,
227
- };
228
-
229
- export default {
230
- FSWatcher,
231
- StatWatcher,
232
- Stats,
233
- BigIntStats,
234
- Dirent,
235
- Dir,
236
- constants,
237
- existsSync,
238
- readdirSync,
239
- readFileSync,
240
- writeFileSync,
241
- mkdirSync,
242
- rmdirSync,
243
- unlinkSync,
244
- mkdtempSync,
245
- rmSync,
246
- statSync,
247
- openSync,
248
- realpathSync,
249
- symlinkSync,
250
- lstatSync,
251
- renameSync,
252
- copyFileSync,
253
- accessSync,
254
- appendFileSync,
255
- readlinkSync,
256
- linkSync,
257
- truncateSync,
258
- chmodSync,
259
- chownSync,
260
- cpSync,
261
- opendirSync,
262
- globSync,
263
- glob,
264
- watch,
265
- watchFile,
266
- unwatchFile,
267
- statfsSync,
268
- statfs,
269
- utimesSync, utimes, lutimesSync, lutimes,
270
- lchownSync, lchown, lchmodSync, lchmod,
271
- fstatSync, fstat,
272
- ftruncateSync, ftruncate,
273
- fdatasyncSync, fdatasync,
274
- fsyncSync, fsync,
275
- fchmodSync, fchmod,
276
- fchownSync, fchown,
277
- futimesSync, futimes,
278
- closeSync, readSync, writeSync,
279
- readvSync, readv,
280
- writevSync, writev,
281
- exists, openAsBlob,
282
- createReadStream,
283
- ReadStream,
284
- createWriteStream,
285
- WriteStream,
286
- promises,
287
- open,
288
- close,
289
- read,
290
- write,
291
- rm,
292
- realpath,
293
- readdir,
294
- symlink,
295
- lstat,
296
- stat,
297
- rename,
298
- copyFile,
299
- cp,
300
- access,
301
- appendFile,
302
- readlink,
303
- truncate,
304
- chmod,
305
- chown,
306
- mkdir,
307
- rmdir,
308
- readFile,
309
- writeFile,
310
- unlink,
311
- link,
312
- opendir,
313
- };