Skip to main content
Deno 2 is finally here πŸŽ‰οΈ
Learn more

πŸ“ Recursive Readdir

Simply recursively read a directory in Deno.

import { recursiveReaddir } from "https://raw.githubusercontent.com/denorg/recursive-readdir/master/mod.ts";

const files = await recursiveReaddir("path/to/dir"); // string[]

Required permissions:

  1. --allow-read

πŸ’‘ Recipes

Search for all markdown files in the content folder:

import { recursiveReaddir } from "https://raw.githubusercontent.com/denorg/recursive-readdir/master/mod.ts";
import { join, extname } from "https://deno.land/std/path/mod.ts";

const markdownFiles = (await recursiveReaddir(join(".", "content"))).filter(
  (file: string) => extname(file) === ".md"
);

πŸ‘©β€πŸ’» Development

Run tests:

deno test --allow-read

πŸ“„ License

MIT Β© Anand Chowdhary