摘要:
//1:字节 byte//1024b = 1kb [千字节]//1024kb = 1mb [兆字节]//1024mb = 1gb [吉字节]//1024gb = 1tb [梯]//1024tb = 1pb //1:创建大小为1024字节缓冲区var buf1 = Buffer.alloc(1024) 阅读全文
摘要:
const url = require("url");var u = "https://www.jd.com:443/ad/index?uname=qd";//将url解析js对象var obj = url.parse(u);console.log(obj);//true:指定querystring 阅读全文
摘要:
const qs =require('querystring'); var str="uname=tom&upwd=123&pno=33&kw=js;" //查询字符串转成对象 var obj=qs.parse(str); console.log(obj) // 输出JS对象{uname:'tom' 阅读全文
摘要:
JS文件中const fs = require("fs");console.log("开始进入文件读取..");//同步的写入var data = fs.readFileSync("./public/1.html"); console.log("文件读取完成");console.log(data); 阅读全文