vvvfs 0.0.2 → 0.0.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.
package/README.md CHANGED
@@ -41,17 +41,18 @@ const vvvfs = new VVVFS("vvvfs", {
41
41
  // 所有操作都是异步的
42
42
  (async function () {
43
43
  await vvvfs.reset(); // 重置文件系统
44
+ await vvvfs.init("UserName"); // 初始化文件系统
44
45
  await vvvfs.createDir("/home/user/Desktop"); // 创建目录,返回true和false
45
46
  await vvvfs.writeText(
46
47
  "/home/user/Desktop/test.txt",
47
48
  "Hello World!"
48
49
  ); // 写入文本文件,写入文件还包括write(path: string, content: Blob)和writeJson(path: string, content: Record<string, any>)方法,返回true和false
49
- console.log(await vvvfs.readText("/home/user/Desktop/test.txt")); // 读取文本文件,读取文件还包括read(path: string): Blob和readJson(path: string): Record<string, any>方法
50
+ console.log(await vvvfs.readText("/home/user/Desktop/test.txt")); // 读取文本文件,读取文件还包括read(path: string): Blob | null和readJson(path: string): Record<string, any> | null方法
50
51
  await vvvfs.delete("/home/user/Desktop/test.txt"); // 删除文件,返回true和false
51
52
  if (await vvvfs.exists("/home/user/Desktop")) {
52
53
  // 判断文件或目录是否存在
53
54
  }
54
- console.log(await vvvfs.list("/home/user/Desktop")); // 列出目录下的文件,返回string[]
55
+ console.log(await vvvfs.list("/home/user/Desktop")); // 列出目录下的文件,返回string[] | null
55
56
  if (await vvvfs.isDir("/home/user/Desktop")) {
56
57
  // 判断是否为目录
57
58
  }
@@ -70,12 +71,21 @@ const vvvfs = new VVVFS("vvvfs", {
70
71
  "/home/user/Desktop/test.txt",
71
72
  "/home/user/Desktop/test2.txt",
72
73
  ); // 复制文件,返回true和false
73
- await vvvfs.search("/home/user/Desktop", "test.txt"); // 搜索文件,返回string[]
74
+ await vvvfs.search("/home/user/Desktop", "test.txt"); // 搜索文件,返回string[] | null
74
75
  })();
75
76
  ```
76
77
 
77
78
  ## 更新日志
78
79
 
80
+ ### 0.0.4
81
+ - 修复IndexDB弹出一堆警告
82
+ - 修复 `search` 搜索时的bug
83
+
84
+ ### 0.0.3
85
+ - 添加完整路径和文件名最长值限制,完整路径最长4096字符,文件名最长255字符
86
+ - 添加 `init` 方法,用于初始化Linux文件和目录
87
+ - 修复 `list` 方法列出根目录时返回的数组中有空字符串的bug,该空字符串是根目录自身
88
+
79
89
  ### 0.0.2
80
90
  - 添加 `throwError` 选项,默认为 `false`
81
91