企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
~~~ const util = require("util"); const fs = require("fs"); util //对fs.readFile进行模块的包装,封装成promise .promisify(fs.readFile)("./package.json") .then(JSON.parse) .then(data => { console.log(data); }).catch(err=>{ console.log(err) }) ~~~