Home / Function/ isFileReadable() — vite Function Reference

isFileReadable() — vite Function Reference

Architecture documentation for the isFileReadable() function in utils.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  98952751_e0cf_2bf3_c4a0_2fde2526872b["isFileReadable()"]
  031bc221_67a8_c579_f2bf_bb30a08beeb2["utils.ts"]
  98952751_e0cf_2bf3_c4a0_2fde2526872b -->|defined in| 031bc221_67a8_c579_f2bf_bb30a08beeb2
  fe25e7e9_e8e7_d04f_5c4c_9b4e6daa8350["checkLoadingAccess()"]
  fe25e7e9_e8e7_d04f_5c4c_9b4e6daa8350 -->|calls| 98952751_e0cf_2bf3_c4a0_2fde2526872b
  c4ce9dee_6723_e494_9564_5fb2aa863733["hasWorkspacePackageJSON()"]
  c4ce9dee_6723_e494_9564_5fb2aa863733 -->|calls| 98952751_e0cf_2bf3_c4a0_2fde2526872b
  a9bd45ce_8339_2b77_7543_41c306ebdb02["tryStatSync()"]
  98952751_e0cf_2bf3_c4a0_2fde2526872b -->|calls| a9bd45ce_8339_2b77_7543_41c306ebdb02
  style 98952751_e0cf_2bf3_c4a0_2fde2526872b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/node/utils.ts lines 568–581

export function isFileReadable(filename: string): boolean {
  if (!tryStatSync(filename)) {
    return false
  }

  try {
    // Check if current process has read permission to the file
    fs.accessSync(filename, fs.constants.R_OK)

    return true
  } catch {
    return false
  }
}

Domain

Subdomains

Frequently Asked Questions

What does isFileReadable() do?
isFileReadable() is a function in the vite codebase, defined in packages/vite/src/node/utils.ts.
Where is isFileReadable() defined?
isFileReadable() is defined in packages/vite/src/node/utils.ts at line 568.
What does isFileReadable() call?
isFileReadable() calls 1 function(s): tryStatSync.
What calls isFileReadable()?
isFileReadable() is called by 2 function(s): checkLoadingAccess, hasWorkspacePackageJSON.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free