Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fathym_common/src/common/path/getFilesList.ts>getFilesList

The Fathym Reference Architecture provides the common foundation for applications built in Typescript.
Go to Latest
function getFilesList
import { getFilesList } from "https://deno.land/x/fathym_common@v0.2.147-integration/src/common/path/getFilesList.ts";

Retrieves a list of files in the specified directory, optionally filtering by extension. Use the meta to give the file list current context.

Examples

From direct import

import { getFilesList } from '@fathym/common/path';

const fileList = await getFilesList({
  Directory: '/path/to/directory',
});

From common import - With Meta and Extensions

import { getFilesList } from '@fathym/common';

const fileList = await getFilesList({
  Directory: '/path/to/directory',
  Extensions: ['.txt', '.js'],
}, import.meta);

Parameters

The request for the file list.

optional
meta: ImportMeta

The meta to give the file list current context.

Returns

Promise<string[]>

The list of files in the specified directory, optionally filtered by extension.