Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/easy_std/src/fs.ts>findFile

Generic Deno standard library, focused on ease of use | 通用 Deno 标准库,专注于易用性
Go to Latest
function findFile
import { findFile } from "https://deno.land/x/easy_std@v0.7.0/src/fs.ts";

Find possible files will return a random file that exists requires the --allow-read flag.

Examples

Example 1

import { findFile } from "https://deno.land/x/easy_std@version/src/fs.ts";

await findFile(['file1.txt', 'file2.txt']) // Randomly return the one that exists, or report an error if all of them do not exist

Parameters

paths: string[]