summaryrefslogtreecommitdiff
path: root/cli/js/read_dir.ts
diff options
context:
space:
mode:
authordubiousjim <dubiousjim@gmail.com>2020-03-02 10:19:42 -0500
committerGitHub <noreply@github.com>2020-03-02 10:19:42 -0500
commit6cd46fa3ef4b12f35a60f1a33c7f038c06b5fc71 (patch)
treee8ef21a936ebac529a7c8e87681123fbd225ff5f /cli/js/read_dir.ts
parent809019dc6e9a80843affc927fa7a52cd41e76471 (diff)
Cleanup comments and internal variables (#4205)
Diffstat (limited to 'cli/js/read_dir.ts')
-rw-r--r--cli/js/read_dir.ts14
1 files changed, 9 insertions, 5 deletions
diff --git a/cli/js/read_dir.ts b/cli/js/read_dir.ts
index 948bad044..43223e015 100644
--- a/cli/js/read_dir.ts
+++ b/cli/js/read_dir.ts
@@ -15,19 +15,23 @@ function res(response: ReadDirResponse): FileInfo[] {
);
}
-/** Reads the directory given by path and returns a list of file info
- * synchronously.
+/** Synchronously reads the directory given by `path` and returns an array of
+ * `Deno.FileInfo`.
*
* const files = Deno.readDirSync("/");
- */
+ *
+ * Requires `allow-read` permission. */
export function readDirSync(path: string): FileInfo[] {
return res(sendSync("op_read_dir", { path }));
}
-/** Reads the directory given by path and returns a list of file info.
+/** UNSTABLE: Maybe need to return an `AsyncIterable`.
+ *
+ * Reads the directory given by `path` and resolves to an array of `Deno.FileInfo`.
*
* const files = await Deno.readDir("/");
- */
+ *
+ * Requires `allow-read` permission. */
export async function readDir(path: string): Promise<FileInfo[]> {
return res(await sendAsync("op_read_dir", { path }));
}