摘要:
阅读全文
摘要:
* 封装一个函数 mineReadFile 读取文件内容 * 参数: path 文件路径 * 返回: promise 对象 */ function mineReadFile(path){ return new Promise((resolve, reject) => { //读取文件 require 阅读全文
摘要:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Promise 封 阅读全文
摘要:
// const fs = require('fs'); //回调函数 形式 // fs.readFile('./resource/content.txt', (err, data) => { // // 如果出错 则抛出错误 // if(err) throw err; // //输出文件内容 // 阅读全文
摘要:
阅读全文