post_img

07-HTTP模块

摘要

HTTP模块 简单的HTTP服务器 const http = require(“http”); const server = ht …

post_img

06-常用工具模块

摘要

常用工具模块 Util模块 方法名 描述 util.format(format[,…args]) 格式化输出,c语言的prin …

post_img

05-路径模块

摘要

路径模块 本地路径模块 解析路径 方法名 描述 path.dirname(path) 获取文件的所在目录 path.basenam …

post_img

04-文件系统

摘要

文件系统 缓冲区 全局模块,作用于输入输出流的数据 静态方法 方法名 描述 Buffer.from(obj) 将数组、对象、字符串 …

post_img

03-进程模块

摘要

进程模块 全局模块,该对象存储node进程相关信息 属性名 描述 process.argv 执行node时的参数列表,比如node …

post_img

02-NPM包管理工具

摘要

NPM包管理工具 npm是node package manager的简称,是nodejs的包管理工具,用于node插件的安装卸载, …

post_img

01-模块化规范

摘要

模块化规范 CommonJS 基本语法 const test = require(“./test”); //模块导入 //会先将t …

post_img

04-AJAX的跨域请求

摘要

AJAX的跨域请求 JSONP 使用script标签向服务器请求一个脚本,这不受跨域影响,所以可以为script标签的src参数填 …

post_img

03-同源限制

摘要

同源限制 目的是为了保证用户信息的安全,网页A的设置的Cookie、LocalStorage和IndexedDB,网页B不能打开, …

post_img

09-模块化

摘要

模块化 导入导出语句只能在顶级作用域下,也就是说不能在 if 等语句和函数中 从 v 13.2 版本开始,Node. Js 才打开 …