fs.dir
@listenai/lisa_core / Exports / fs / Dir
Class: Dir
fs.Dir
A class representing a directory stream.
#
Table of contents#
Constructors#
Properties#
Methods#
Constructors#
constructor• new Dir()
#
Properties#
path• Readonly
path: string
#
Defined innode_modules/@types/node/fs.d.ts:79
#
Methods#
[Symbol.asyncIterator]▸ [Symbol.asyncIterator](): AsyncIterableIterator
<Dirent
>
Asynchronously iterates over the directory via readdir(3)
until all entries have been read.
#
ReturnsAsyncIterableIterator
<Dirent
>
#
Defined innode_modules/@types/node/fs.d.ts:84
#
close▸ close(): Promise
<void
>
Asynchronously close the directory's underlying resource handle. Subsequent reads will result in errors.
#
ReturnsPromise
<void
>
#
Defined innode_modules/@types/node/fs.d.ts:90
▸ close(cb
): void
#
ParametersName | Type |
---|---|
cb | NoParamCallback |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:91
#
closeSync▸ closeSync(): void
Synchronously close the directory's underlying resource handle. Subsequent reads will result in errors.
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:97
#
read▸ read(): Promise
<null
| Dirent
>
Asynchronously read the next directory entry via readdir(3)
as an Dirent
.
After the read is completed, a value is returned that will be resolved with an Dirent
, or null
if there are no more directory entries to read.
Directory entries returned by this function are in no particular order as provided by the operating system's underlying directory mechanisms.
#
ReturnsPromise
<null
| Dirent
>
#
Defined innode_modules/@types/node/fs.d.ts:104
▸ read(cb
): void
#
ParametersName | Type |
---|---|
cb | (err : null | ErrnoException , dirEnt : null | Dirent ) => void |
#
Returnsvoid
#
Defined innode_modules/@types/node/fs.d.ts:105
#
readSync▸ readSync(): null
| Dirent
Synchronously read the next directory entry via readdir(3)
as a Dirent
.
If there are no more directory entries to read, null will be returned.
Directory entries returned by this function are in no particular order as provided by the operating system's underlying directory mechanisms.
#
Returnsnull
| Dirent
#
Defined innode_modules/@types/node/fs.d.ts:112