@augment-vir/node
Version:
A collection of augments, helpers types, functions, and classes only for Node.js (backend) JavaScript environments.
25 lines (24 loc) • 946 B
TypeScript
import { type RequireExactlyOne } from 'type-fest';
/**
* Gets all files within a directory and its subdirectories, recursively. Returns an array of paths
* relative to the given input path.
*
* @category Node : File
* @category Package : @augment-vir/node
* @package [`@augment-vir/node`](https://www.npmjs.com/package/@augment-vir/node)
*/
export declare function readDirRecursive(dirPath: string): Promise<string[]>;
/**
* Reads all files within a single directory and filters them by the given extension or extensions.
*
* @category Node : File
* @category Package : @augment-vir/node
* @returns That filtered list of paths.
* @package [`@augment-vir/node`](https://www.npmjs.com/package/@augment-vir/node)
*/
export declare function readDirFilesByExtension({ dirPath, extension, extensions, }: {
dirPath: string;
} & RequireExactlyOne<{
extension: string;
extensions: ReadonlyArray<string>;
}>): Promise<string[]>;