Skip to content

readdirPosix

Reads the contents of a directory and converts file paths or buffer results to POSIX format.

Import:

import { readdirPosix } from '@mnaoumov/typescript-dev-toolkit/fs';

Signature:

function readdirPosix(path: PathLike, options: BufferResultOptions | DirentResultOptions | StringResultOptions): Promise<string[] | Buffer<ArrayBufferLike>[] | Dirent<string>[]>

Parameters:

Parameter Type Description
path PathLike The path to the directory.
options BufferResultOptions | DirentResultOptions | StringResultOptions Options to control the format of the result.

Returns: Promise<string[] | Buffer<ArrayBufferLike>[] | Dirent<string>[]> — A Promise that resolves with an array of POSIX-formatted file paths, buffers, or Dirent objects.