2021年1月4日

571 node的events模块

摘要: 常见的属性 方法的补充 01_events基础方法.js const EventEmitter = require("events"); // 1.创建发射器 const emitter = new EventEmitter(); // 2.监听某一个事件 // addListener是on的ali 阅读全文

posted @ 2021-01-04 21:57 冲啊! 阅读(98) 评论(0) 推荐(0)

570 node内置模块fs

摘要: fs的API介绍 案例:获取一个文件的状态 文件描述符 文件的读写 flag选项 encoding选项 文件夹操作 文件夹的复制 01_fs的三种使用方式.js const fs = require('fs'); // 案例: 读取文件的信息 const filepath = "./abc.txt" 阅读全文

posted @ 2021-01-04 21:20 冲啊! 阅读(97) 评论(0) 推荐(0)

569 node内置模块path

摘要: path常见的API 在webpack中的使用 在webpack中获取路径或者起别名的地方也可以使用 01_路径的演练.js const path = require('path'); const basePath = '/User/why'; const filename = 'abc.txt'; 阅读全文

posted @ 2021-01-04 20:45 冲啊! 阅读(136) 评论(0) 推荐(0)

导航