参数 oldPath 和 newPath 可以是使用 file: 协议的 WHATWG URL 对象。支持目前仍处于试验阶段。
oldPath
newPath
file:
URL
新增于: v0.1.21
oldPath <string> | <Buffer> | <URL>
newPath <string> | <Buffer> | <URL>
将文件从 oldPath 重命名为 newPath。返回 undefined。
undefined
¥Renames the file from oldPath to newPath. Returns undefined.
有关更多详细信息,请参阅 POSIX rename(2) 文档。
rename(2)
¥See the POSIX rename(2) documentation for more details.