【发布时间】:2020-08-18 23:26:03
【问题描述】:
我有一个创建 JSON 的 firebase 函数:
var tempJSONObject = {
testing: "why are we testing",
anothertest:"constanttesting"
}
我有一个临时文件:
const tempFilePath = path.join(os.tmpdir(), data.jokeid);
如何将我的 JSON 保存到这个临时文件中,以便我可以将文件上传到 Firebase 存储?我必须这样做,因为当我将 JSON 直接传递给 bucket.upload() 时,它会要求我提供文件路径。
【问题讨论】:
标签: node.js firebase google-cloud-functions google-cloud-storage