http:再看
http.get(url,(res)=>{
let sum = "";
res.setEncoding('utf8')
res.on('data' ,(chunk)=>{
sum += chunk
} )
res.on('end',()=>{
console.log(sum)
} )
})
url
url.parse(url)
url.format(obj)
url.resolve(url + 'abc')
querystring
qs.parse(str,[';'],[':'])
qs.stringify(str,[';'],[':'])
qs.escape(str)
qs.unescape(str)
fs
回调错误优先
文件
fs.writeFile
fs.readFile
fs.appendFile
fs.unlink
fs.existSync 是否存在
文件夹
fs.mkdir 创建
fs.rmdir 删除
fs.readdir 读取文件夹内容
fs.stat
10.0以上版本
var s = fs.promises
fs.watch(url,(eventType,filename)=>{
})
fs.watchFile(url,(current,previous)=>{
})
流
const readStream = fs.createReadStream('url')
const writeStream = fs.createWriteStream('url')
readStream.pipe(writeStream)
zlib
zlib
gzip = zlib.createGzip
events
events.on()
events.once()
events.off()
events.emit ()
path
path.extname()
static
静态资源访问
router
你的文章让我心情愉悦,每天都要来看一看。 https://www.4006400989.com/qyvideo/51090.html
你的文章让我感受到了艺术的魅力,谢谢! https://www.yonboz.com/video/17340.html