文件 URL 路径
对于大多数 node:fs 模块函数,path 或 filename 参数可以作为使用 file: 协议的 <URL> 对象传入。
import { readFileSync } from 'node:fs';
readFileSync(new URL('file:///tmp/hello'));file: URL 始终是绝对路径。
For most node:fs module functions, the path or filename argument may be
passed as a <URL> object using the file: protocol.
import { readFileSync } from 'node:fs';
readFileSync(new URL('file:///tmp/hello'));file: URLs are always absolute paths.