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