摘要:
// 1. 导入 http 模块 const http = require('http') // 2. 创建 web 服务器实例 const server = http.createServer() // 3. 为服务器实例绑定 request 事件,监听客户端的请求 server.on('requ 阅读全文
posted @ 2022-05-28 18:13
hi123hi159
阅读(55)
评论(0)
推荐(0)
摘要:
// 1.1 导入 fs 模块 const fs = require('fs') // 1.2 导入 path 模块 const path = require('path') // 1.3 定义正则表达式,分别匹配 <style></style> 和 <script></script> 标签 con 阅读全文
posted @ 2022-05-28 15:46
hi123hi159
阅读(109)
评论(0)
推荐(0)
摘要:
const path = require('path') // 这是文件的存放路径 const fpath = '/a/b/c/index.html' const fext = path.extname(fpath) console.log(fext) 阅读全文
posted @ 2022-05-28 15:02
hi123hi159
阅读(302)
评论(0)
推荐(0)
摘要:
const path = require('path') // 定义文件的存放路径 const fpath = '/a/b/c/index.html' // const fullName = path.basename(fpath) // console.log(fullName) const na 阅读全文
posted @ 2022-05-28 14:42
hi123hi159
阅读(437)
评论(0)
推荐(0)
摘要:
const path = require('path') const fs = require('fs') // 注意: ../ 会抵消前面的路径 // const pathStr = path.join('/a', '/b/c', '../../', './d', 'e') // console. 阅读全文
posted @ 2022-05-28 13:08
hi123hi159
阅读(643)
评论(0)
推荐(0)
浙公网安备 33010602011771号