Skip to content

denorg/recursive-readdir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“ Recursive Readdir

Recursively read a directory in Deno.

Deno CI GitHub Contributors Deno Starter Made by Denorg TypeScript semantic-release

import { recursiveReaddir } from "https://deno.land/x/recursive_readdir/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://deno.land/x/recursive_readdir/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 Β© Denorg

A project by Denorg, the world's first Deno-focused community
organization and consulting company. Work with us β†’