Deno.readdirsync
readdirSync
- 
readdirSync(path: string): Iterable<DirEntry> 
- 
同步读取 path文件目录,并返回Deno.DirEntry迭代器。Synchronously reads the directory given by pathand returns an iterable ofDeno.DirEntry.for (const dirEntry of Deno.readdirSync("/")) { console.log(dirEntry.name); }如果 path不是目录则抛出错误。Throws error if pathis not a directory.需要 allow-read权限。Requires allow-readpermission.
参数
-   ##### path: string
返回 Iterable<DirEntry>
realpath
- 
realpath(path: string): Promise<string> 
- 
返回被解析后的符号链接绝对路径。 Resolves to the absolute normalized path, with symbolic links resolved. // e.g. given /home/alice/file.txt and current directory /home/alice await Deno.symlink("file.txt", "symlink_file.txt"); const realPath = await Deno.realpath("./file.txt"); const realSymLinkPath = await Deno.realpath("./symlink_file.txt"); console.log(realPath); // outputs "/home/alice/file.txt" console.log(realSymLinkPath); //outputs "/home/alice/file.txt"需要 allow-read权限Requires allow-readpermission.
参数
-   ##### path: string
 
                             
                             
                             
                            