ZenFS
    Preparing search index...

    Class Dirent<Name>

    Type Parameters

    • Name extends string | Buffer = string

    Implements

    Index
    • Type Parameters

      • Name extends string | Buffer<ArrayBufferLike> = string

      Returns fs.Dirent<Name>

    _encoding?: "buffer" | BufferEncoding | null
    _name: string
    _parentPath: string
    ino: number
    type: DirType
    • get name(): Name

      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.

      Returns Name

      v10.10.0

    • get parentPath(): string

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

      Returns string

      v20.12.0, v18.20.0

    • get path(): string

      Returns string

      Removed in Node v24, use parentPath instead.

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

      Returns boolean

      v10.10.0

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

      Returns boolean

      v10.10.0

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

      Returns boolean

      v10.10.0

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

      Returns boolean

      v10.10.0

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

      Returns boolean

      v10.10.0

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

      Returns boolean

      v10.10.0

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

      Returns boolean

      v10.10.0

    • Internal

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

      Parameters

      • vfs: vfs.Dirent
      • Optionalencoding: "buffer" | BufferEncoding | null
      • parentPath: string = '.'

      Returns fs.Dirent<string>