Skip to content

readdirPosix

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

Import:

import { readdirPosix } from 'obsidian-dev-utils/script-utils/fs';

Signature:

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

Parameters:

ParameterTypeDescription
pathPathLikeThe path to the directory.
optionsBufferResultOptions | DirentResultOptions | StringResultOptionsOptions 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.