上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 61 下一页
摘要: //延时函数 function sleep(delay) { return new Promise((resolve, reject) => { setTimeout(() => { try { resolve(1) } catch (e) { reject(0) } }, delay) }) } 阅读全文
posted @ 2021-06-16 09:17 13522679763-任国强 阅读(66) 评论(0) 推荐(0)
摘要: const axios = require("axios"); const fs = require('fs'); async function getPage(num){ let httpUrl = 'http://www.app-echo.com/api/recommend/sound-day? 阅读全文
posted @ 2021-06-15 18:10 13522679763-任国强 阅读(50) 评论(0) 推荐(0)
摘要: const cheerio = require('cheerio'); const axios = require('axios') const fs = require('fs') const path = require('path') let httpUrL = 'https://www.do 阅读全文
posted @ 2021-06-15 18:08 13522679763-任国强 阅读(78) 评论(0) 推荐(0)
摘要: // js 睡眠函数 sleep(3) number 间隔秒数 function sleep(number){ var now = new Date(); var exitTime = now.getTime() + number * 1000; while (true) { now = new D 阅读全文
posted @ 2021-06-15 15:27 13522679763-任国强 阅读(3237) 评论(0) 推荐(0)
摘要: 老陈打码 json 开始看第10课 json { "name": "laochen", "version": "1.0.0", "description": "", "main": "index.js", "dependencies": { "axios": "^0.21.1", "jquery": 阅读全文
posted @ 2021-06-14 22:42 13522679763-任国强 阅读(62) 评论(0) 推荐(0)
摘要: let fs = require('fs'); // 创建读取流 fs.createReadStream(路径【配置项】) // let rs = fs.createReadStream('hello.txt',{flag:"r",encoding:"utf-8"}); let rs = fs.cr 阅读全文
posted @ 2021-06-14 19:30 13522679763-任国强 阅读(173) 评论(0) 推荐(0)
摘要: let fs = require('fs'); // 1 创建写入流 // fs.createWriteStream(文件路径,[可选择的配置操作]) // 2 let ws = fs.createWriteStream("hello.txt",{flag:'w',encoding:"utf8"}) 阅读全文
posted @ 2021-06-14 18:28 13522679763-任国强 阅读(117) 评论(0) 推荐(0)
摘要: let fs = require('fs') // 封装 异步读取文件 function fsRead(path){ return new Promise(function(resolve,reject){ fs.readFile(path,{flag:"r",encoding:"utf-8"},f 阅读全文
posted @ 2021-06-14 17:22 13522679763-任国强 阅读(718) 评论(0) 推荐(0)
摘要: let fs = require('fs') // 异步 写入文件 // write w 写入 // read r 读取 // append a 追加 // fs.writeFile('test.txt',"鱼香茄子\n",{flag:"a",encoding:"utf-8"},function(e 阅读全文
posted @ 2021-06-14 17:02 13522679763-任国强 阅读(503) 评论(0) 推荐(0)
摘要: var fs = require('fs'); // 同步 读取文件内容 // var conent = fs.readFileSync('hello.txt',{flag:'r',encoding:'utf-8'}) // console.log(123); // console.log(cone 阅读全文
posted @ 2021-06-14 17:00 13522679763-任国强 阅读(380) 评论(0) 推荐(0)
上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 61 下一页