vvvfs 0.0.1 → 0.0.3

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/index.html CHANGED
@@ -11,18 +11,23 @@
11
11
  <body>
12
12
  <script>
13
13
  (async () => {
14
- globalThis.vvvfs = new VVVFS();
15
- await vvvfs.reset();
16
- console.log(vvvfs);
17
- console.log("创建文件", await vvvfs.createFile("/test.txt"));
18
- console.log("写入文件", await vvvfs.writeText("/test.txt", "Hello World"));
19
- console.log("文件是否存在", await vvvfs.exists("/test.txt"));
20
- console.log("文件是否存在", await vvvfs.exists("/test2.txt"));
21
- console.log("读取文件", await vvvfs.readText("/test.txt"));
22
- console.log("复制文件", await vvvfs.copy("/test.txt", "/test2.txt"));
23
- console.log("搜索文件", await vvvfs.search("test"));
24
- console.log("移动文件", await vvvfs.move("/test2.txt", "/test3.txt"));
25
- console.log("删除文件", await vvvfs.delete("/test.txt"));
14
+ try {
15
+ globalThis.vvvfs = new VVVFS();
16
+ await vvvfs.reset();
17
+ await vvvfs.init("IFTC");
18
+ console.log(vvvfs);
19
+ console.log("创建文件", await vvvfs.createFile("/test.txt"));
20
+ console.log("写入文件", await vvvfs.writeText("/test.txt", "Hello World"));
21
+ console.log("文件是否存在", await vvvfs.exists("/test.txt"));
22
+ console.log("文件是否存在", await vvvfs.exists("/test2.txt"));
23
+ console.log("读取文件", await vvvfs.readText("/test.txt"));
24
+ console.log("复制文件", await vvvfs.copy("/test.txt", "/test2.txt"));
25
+ console.log("搜索文件", await vvvfs.search("test"));
26
+ console.log("移动文件", await vvvfs.move("/test2.txt", "/test3.txt"));
27
+ console.log("删除文件", await vvvfs.delete("/test.txt"));
28
+ } catch (error) {
29
+ console.error(error);
30
+ }
26
31
  })();
27
32
  </script>
28
33
  </body>