Loading

摘要: path模块提供了操作路径相关的功能 // 导入 const path = require('path') // 一些常用的api //获取路径分隔符 console.log(path.sep) //拼接绝对路径 console.log(path.resolve(__dirname, 'test') 阅读全文
posted @ 2024-12-13 15:54 木子七 阅读(26) 评论(0) 推荐(0)
摘要: fs 全称为 file system ,称之为 文件系统 ,是 Node.js 中的 内置模块, fs模块可以实现与硬盘的交互,例如文件的创建、删除、重命名、移动,内容的写入读取等以及文件夹相关操作 写入文件 异步写入 // 导入fs模块 const fs = require("fs") // 写入 阅读全文
posted @ 2024-12-13 15:44 木子七 阅读(158) 评论(0) 推荐(0)