-
-
Notifications
You must be signed in to change notification settings - Fork 133
/
Copy pathfs.ts
163 lines (160 loc) · 4.92 KB
/
fs.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
// Run: npx ts-node demo/print/fs.ts
import * as fs from 'fs';
import { toTreeSync } from '../../src/print';
console.log(toTreeSync(<any>fs, { dir: process.cwd() + '/src/fsa-to-node' }));
// Output:
// src/
// ├─ Dirent.ts
// ├─ Stats.ts
// ├─ __tests__/
// │ ├─ hasBigInt.js
// │ ├─ index.test.ts
// │ ├─ node.test.ts
// │ ├─ process.test.ts
// │ ├─ promises.test.ts
// │ ├─ setImmediate.test.ts
// │ ├─ setTimeoutUnref.test.ts
// │ ├─ util.ts
// │ ├─ volume/
// │ │ ├─ ReadStream.test.ts
// │ │ ├─ WriteStream.test.ts
// │ │ ├─ __snapshots__/
// │ │ │ ├─ mkdirSync.test.ts.snap
// │ │ │ ├─ renameSync.test.ts.snap
// │ │ │ └─ writeSync.test.ts.snap
// │ │ ├─ appendFile.test.ts
// │ │ ├─ appendFileSync.test.ts
// │ │ ├─ closeSync.test.ts
// │ │ ├─ copyFile.test.ts
// │ │ ├─ copyFileSync.test.ts
// │ │ ├─ exists.test.ts
// │ │ ├─ existsSync.test.ts
// │ │ ├─ mkdirSync.test.ts
// │ │ ├─ openSync.test.ts
// │ │ ├─ readFile.test.ts
// │ │ ├─ readSync.test.ts
// │ │ ├─ readdirSync.test.ts
// │ │ ├─ realpathSync.test.ts
// │ │ ├─ rename.test.ts
// │ │ ├─ renameSync.test.ts
// │ │ ├─ rmPromise.test.ts
// │ │ ├─ rmSync.test.ts
// │ │ ├─ statSync.test.ts
// │ │ ├─ toString.test.ts
// │ │ ├─ write.test.ts
// │ │ ├─ writeFileSync.test.ts
// │ │ └─ writeSync.test.ts
// │ └─ volume.test.ts
// ├─ cas/
// │ ├─ README.md
// │ └─ types.ts
// ├─ constants.ts
// ├─ consts/
// │ ├─ AMODE.ts
// │ └─ FLAG.ts
// ├─ crud/
// │ ├─ README.md
// │ ├─ __tests__/
// │ │ ├─ matryoshka.test.ts
// │ │ └─ testCrudfs.ts
// │ ├─ types.ts
// │ └─ util.ts
// ├─ crud-to-cas/
// │ ├─ CrudCas.ts
// │ ├─ __tests__/
// │ │ ├─ CrudCas.test.ts
// │ │ ├─ __snapshots__/
// │ │ │ └─ CrudCas.test.ts.snap
// │ │ └─ testCasfs.ts
// │ ├─ index.ts
// │ └─ util.ts
// ├─ encoding.ts
// ├─ fsa/
// │ └─ types.ts
// ├─ fsa-to-crud/
// │ ├─ FsaCrud.ts
// │ ├─ __tests__/
// │ │ └─ FsaCrud.test.ts
// │ ├─ index.ts
// │ └─ util.ts
// ├─ fsa-to-node/
// │ ├─ FsaNodeCore.ts
// │ ├─ FsaNodeDirent.ts
// │ ├─ FsaNodeFs.ts
// │ ├─ FsaNodeFsOpenFile.ts
// │ ├─ FsaNodeReadStream.ts
// │ ├─ FsaNodeStats.ts
// │ ├─ FsaNodeWriteStream.ts
// │ ├─ __tests__/
// │ │ ├─ FsaNodeFs.test.ts
// │ │ └─ util.test.ts
// │ ├─ constants.ts
// │ ├─ index.ts
// │ ├─ json.ts
// │ ├─ types.ts
// │ ├─ util.ts
// │ └─ worker/
// │ ├─ FsaNodeSyncAdapterWorker.ts
// │ ├─ FsaNodeSyncWorker.ts
// │ ├─ SyncMessenger.ts
// │ ├─ constants.ts
// │ └─ types.ts
// ├─ index.ts
// ├─ internal/
// │ ├─ buffer.ts
// │ └─ errors.ts
// ├─ node/
// │ ├─ FileHandle.ts
// │ ├─ FsPromises.ts
// │ ├─ constants.ts
// │ ├─ lists/
// │ │ ├─ fsCallbackApiList.ts
// │ │ ├─ fsCommonObjectsList.ts
// │ │ └─ fsSynchronousApiList.ts
// │ ├─ options.ts
// │ ├─ types/
// │ │ ├─ FsCallbackApi.ts
// │ │ ├─ FsCommonObjects.ts
// │ │ ├─ FsPromisesApi.ts
// │ │ ├─ FsSynchronousApi.ts
// │ │ ├─ index.ts
// │ │ ├─ misc.ts
// │ │ └─ options.ts
// │ └─ util.ts
// ├─ node-to-crud/
// │ ├─ NodeCrud.ts
// │ ├─ __tests__/
// │ │ └─ FsaCrud.test.ts
// │ └─ index.ts
// ├─ node-to-fsa/
// │ ├─ NodeFileSystemDirectoryHandle.ts
// │ ├─ NodeFileSystemFileHandle.ts
// │ ├─ NodeFileSystemHandle.ts
// │ ├─ NodeFileSystemSyncAccessHandle.ts
// │ ├─ NodeFileSystemWritableFileStream.ts
// │ ├─ NodePermissionStatus.ts
// │ ├─ README.md
// │ ├─ __tests__/
// │ │ ├─ NodeFileSystemDirectoryHandle.test.ts
// │ │ ├─ NodeFileSystemFileHandle.test.ts
// │ │ ├─ NodeFileSystemHandle.test.ts
// │ │ ├─ NodeFileSystemSyncAccessHandle.test.ts
// │ │ ├─ NodeFileSystemWritableFileStream.test.ts
// │ │ ├─ scenarios.test.ts
// │ │ └─ util.test.ts
// │ ├─ index.ts
// │ ├─ types.ts
// │ └─ util.ts
// ├─ node.ts
// ├─ print/
// │ ├─ __tests__/
// │ │ └─ index.test.ts
// │ └─ index.ts
// ├─ process.ts
// ├─ setImmediate.ts
// ├─ setTimeoutUnref.ts
// ├─ volume-localstorage.ts
// ├─ volume.ts
// └─ webfs/
// ├─ index.ts
// └─ webpack.config.js