fsPromises.symlink(target, path[, type])
target<string> | <Buffer> | <URL>path<string> | <Buffer> | <URL>type<string> | <null> 默认:null- 返回:<Promise> 成功时返回
undefined。
创建符号链接。
【Creates a symbolic link.】
type 参数仅在 Windows 平台上使用,可以是 'dir'、'file' 或 'junction'。如果 type 参数不是字符串,Node.js 会自动检测 target 的类型,并使用 'file' 或 'dir'。如果 target 不存在,将使用 'file'。Windows 联接点要求目标路径为绝对路径。使用 'junction' 时,target 参数会自动规范化为绝对路径。NTFS 卷上的联接点只能指向目录。
【The type argument is only used on Windows platforms and can be one of 'dir',
'file', or 'junction'. If the type argument is not a string, Node.js will
autodetect target type and use 'file' or 'dir'. If the target does not
exist, 'file' will be used. Windows junction points require the destination
path to be absolute. When using 'junction', the target argument will
automatically be normalized to absolute path. Junction points on NTFS volumes
can only point to directories.】