第3节 文件系统和路径模块

一、fs

  • readFile
  • writeFile
  • rename
  • existsSync
  • stat
  • unlink

  • mkdir

  • readdir

使用fs.read和fs.write读写文件需要使用fs.open打开文件和fs.close关闭文件

在读写文件 或者 网络传输下载

异步asynchronous 同步 synchronous

二、path

join


basename
extname

dirname
resolve

normalize
parse
format

以应用程序为起点,根据参数字符串解析出一个绝对路径

results matching ""

    No results matching ""