Skip to content

Dirent

Defined in: src/node/dir.ts:14

Name extends string | Buffer = string

  • Dirent<Name>

new Dirent<Name>(): Dirent<Name>

Dirent<Name>

protected optional _encoding?: "buffer" | BufferEncoding | null

Defined in: src/node/dir.ts:27

Internal


protected _name: string

Defined in: src/node/dir.ts:17


protected _parentPath: string

Defined in: src/node/dir.ts:32

Internal


ino: number

Defined in: src/node/dir.ts:15


type: DirType

Defined in: src/node/dir.ts:16

get name(): Name

Defined in: src/node/dir.ts:19

The file name that this fs.Dirent object refers to. The type of this value is determined by the options.encoding passed to readdir or readdirSync.

v10.10.0

Name

_Dirent.name


get parentPath(): string

Defined in: src/node/dir.ts:34

The path to the parent directory of the file this fs.Dirent object refers to.

v20.12.0, v18.20.0

string

_Dirent.parentPath


get path(): string

Defined in: src/node/dir.ts:41

string

isBlockDevice(): boolean

Defined in: src/node/dir.ts:68

Returns true if the fs.Dirent object describes a block device.

boolean

v10.10.0

_Dirent.isBlockDevice


isCharacterDevice(): boolean

Defined in: src/node/dir.ts:71

Returns true if the fs.Dirent object describes a character device.

boolean

v10.10.0

_Dirent.isCharacterDevice


isDirectory(): boolean

Defined in: src/node/dir.ts:65

Returns true if the fs.Dirent object describes a file system directory.

boolean

v10.10.0

_Dirent.isDirectory


isFIFO(): boolean

Defined in: src/node/dir.ts:77

Returns true if the fs.Dirent object describes a first-in-first-out (FIFO) pipe.

boolean

v10.10.0

_Dirent.isFIFO


isFile(): boolean

Defined in: src/node/dir.ts:62

Returns true if the fs.Dirent object describes a regular file.

boolean

v10.10.0

_Dirent.isFile


isSocket(): boolean

Defined in: src/node/dir.ts:80

Returns true if the fs.Dirent object describes a socket.

boolean

v10.10.0

_Dirent.isSocket


isSymbolicLink(): boolean

Defined in: src/node/dir.ts:74

Returns true if the fs.Dirent object describes a symbolic link.

boolean

v10.10.0

_Dirent.isSymbolicLink


static from(vfs, encoding?, parentPath?): Dirent<string>

Defined in: src/node/dir.ts:51

Internal

vfs.path is relative to the directory that was read, so parentPath is resolved against it— like Node does.

Dirent

"buffer" | BufferEncoding | null

string = '.'

Dirent<string>