通过 Electron/Node 确定 file/foder 是否隐藏在 Windows 中

Determine if file/foder is hidden in Windows via Electron/Node

有没有办法确定 Windows 中的文件隐藏在 Electron 中。我需要知道文件属性中设置的隐藏属性,而不是前面有一个点的文件名。目前正在使用 fs 获取文件系统信息 我无法获取此信息。

一些示例用例是(使用 Typescript):

import fs = require('fs');

getVisibleFilesSync(): string[] {
    const folderItems = fs.readdirSync(folderPath);
    return folderItems.filter(x => !isHidden(x));
}

isHidden(path: string): boolean {
    // how to determine if path is hidden under Windows?
}

尝试使用 isHiddenSync function in the hidefile 模块。