当前位置:网站首页>今天的码农女孩学习了关于nodejs和REPL 交互式解释器的知识
今天的码农女孩学习了关于nodejs和REPL 交互式解释器的知识
2022-07-17 00:06:00 【丁丁丁dingdingding】
nodejs介绍
nodejs是运行在服务器端的js,是基于chrome javascript运行时建立的一个平台,是一个事件驱动,I/O服务端,js的运行环境基于Google的v8引擎,底层是由c编写
v8引擎:v8被设计用来提高浏览器内部js执行的性能,让js的速度非常快,性能好。会把js代码转化为高效的机器代码,而不再依赖于解释器去执行
node特点:
1.性能优化:异步io,支持多个进程并发处理
2.安全性:node是一个中间层,当黑客要攻击时,先通过node服务器
3.处理数据:当后台返回大量数据到前台,读取数据类型更方便,处理更快
4.编译js:可以处理js代码,ES6语法,typescript语法
npm命令
1.node -v 查看node版本
2.npm -v 查看npm版本
3.npm install 模块名 -g 全局安装
4. npm install 模块名 -s 当前环境下安装
5.npm install 模块名 -g --registry=https://registry.npm.taobao.org 使用国内镜像下载
6.npm uninstall 模块名 卸载模块
7.npm list -g 查询全局下的安装的模块
8.npm update 模块名 更新模块
9.npm ls 查看包是否还存在
10.npm search 模块名 搜索模块
REPL 交互式解释器
表示一个电脑环境,类似于window系统终端,或者linux的shell,我们可以在终端输入js语法,并接受系统的响应,在命令行可以直接编译js
REPL命令:
1.ctrl+c 一次退出终端
2.ctrl+c 两次退出node
3.ctrl+d 退出node
4.上下键 查看历史输入的命令
5.tab键 列出当前命令
6. .help 列出所有命令
7. .break 退出多行表达式
8. .clear 清空多行表达式
9. .save 文件名 保存当前的node代码
10. .load 文件名 载入node代码文本执行
使用方式:
在命令行下输入node后,可执行以上命令和js语法
例如:下划线变量,可以获取上一次表达式的运算结果
>var a=1
>var b=2
>a+b
>var sum=_
>console.log(sum) //输出3
边栏推荐
- uni-app微信公众号(4)——地址管理页面
- 判断两个时间戳是否是同一天
- uni-app微信小程序——商城(8)——订单详情
- Day04 routing layer
- From catf1ag two-hour AK match pwn/attack killing, summarize the common command guide of emergency response
- js获取一个文件名的后缀格式
- Summary of Applied Cryptography
- Gateway Kong route adding instructions
- (八)Shell函数
- JS get the suffix format of a file name
猜你喜欢

Win10 vscode 代码格式化设置与远程断点调试

深度之眼三——(3)】 數學:矩陣特征值與特征向量1
![The eye of Depth III - - (3)] Mathematics: Matrix eigenvalue and eigenvector 1](/img/81/7ad44da70eaf1d92b126c567766577.png)
The eye of Depth III - - (3)] Mathematics: Matrix eigenvalue and eigenvector 1
![Eye of depth III - (3)] mathematics: matrix eigenvalue and eigenvector 1](/img/81/7ad44da70eaf1d92b126c567766577.png)
Eye of depth III - (3)] mathematics: matrix eigenvalue and eigenvector 1

2022年暑假ACM热身练习2(总结)

object-fit:cover; It doesn't work in the applet. How to deal with the deformation of the applet image

JS get the suffix format of a file name

Oracle database architecture

@Configurationproperties annotation usage

深度之眼三——(7,8)】数学:矩阵对角化及二次型2.3
随机推荐
gtest与gmock的安装与使用
Eye of depth III - (3)] mathematics: matrix eigenvalue and eigenvector 1
mmap的 Bus error问题及解决
Vue项目部署,清理缓存
The C Programming Language (2nd)--笔记--1.8
量化行业知识汇总
cmake的基本使用
Replace special characters in URL (%e2%80%8b)
The C Programming Language(2nd)--笔记--1.10
The C Programing Language-2nd--笔记--4.11.3
Maker-鸿蒙应用开发培训04
Common mode attack and shared prime of RSA
extern和static的区别
Record buuctf [netding Cup 2018] unfinish1 problem solving ideas
[GFCTF 2021]Baby_ Cve-2021-41773 on the web
深度之眼三——(3)】 数学:矩阵特征值与特征向量1
Oracle database 12C parameter files (SPFILE and pfile)
Day10 front back continuous adjustment
Oracle automatic storage management 18C step-by-step installation -2
JSX compilation