fs.statSync(path[, options])


  • path <string> | <Buffer> | <URL>

  • options <Object>

    • bigint <boolean> 返回的 <fs.Stats> 对象中的数值是否应为 bigint。默认值:false

      ¥bigint <boolean> Whether the numeric values in the returned <fs.Stats> object should be bigint. Default: false.

    • throwIfNoEntry <boolean> 如果文件系统条目不存在,是否会抛出异常,而不是返回 undefined。默认值:true

      ¥throwIfNoEntry <boolean> Whether an exception will be thrown if no file system entry exists, rather than returning undefined. Default: true.

  • 返回:<fs.Stats>

    ¥Returns: <fs.Stats>

获取路径的 <fs.Stats>

¥Retrieves the <fs.Stats> for the path.