📜  在 nodejs 中写入文件时创建目录 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:12.296000             🧑  作者: Mango

代码示例1
fs.mkdir now accepts a { recursive: true } option like so:

// Creates /tmp/a/apple, regardless of whether `/tmp` and /tmp/a exist.
fs.mkdir('/tmp/a/apple', { recursive: true }, (err) => {
  if (err) throw err;
});