标签: electron atom-editor
var filepath="path of a file"; var txtFile = new File(filepath);
答案 0 :(得分:1)
错误显示“需要2个参数”。所以你需要两个论点。
尝试
var txtFile = new File([""], filepath);
请参阅How to instantiate a File object in JavaScript?