命名空间: fs
目录
函数
函数
ListDir
▸ ListDir(path, itemType): string[] | null
ListDir 根据提供的 itemType 列出目录中的 itemType 值
itemType 可以是 [‘file’,‘dir’,”] 中的任意一个
参数
| 名称 | 类型 |
|---|---|
path | string |
itemType | string |
返回值
string[] | null
示例
示例
示例
定义于
fs.ts:26ReadFile
▸ ReadFile(path): Uint8Array | null
ReadFile 读取允许路径内的文件内容
并以 byte 数组形式返回内容
参数
| 名称 | 类型 |
|---|---|
path | string |
返回值
Uint8Array | null
示例
定义于
fs.ts:42ReadFileAsString
▸ ReadFileAsString(path): string | null
ReadFileAsString 读取允许路径内的文件内容
并以字符串形式返回内容
参数
| 名称 | 类型 |
|---|---|
path | string |
返回值
string | null
示例
定义于
fs.ts:58ReadFilesFromDir
▸ ReadFilesFromDir(dir): string[] | null
ReadFilesFromDir 从目录中读取所有文件
并返回包含所有文件内容的字符串数组
参数
| 名称 | 类型 |
|---|---|
dir | string |
返回值
string[] | null
示例