2020-10-08 20:38:57 +01:00
|
|
|
|
# node
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
> 服务器后端 JavaScript 平台(Node.js)。
|
2021-08-31 08:13:49 +01:00
|
|
|
|
> 更多信息:<https://nodejs.org>.
|
2020-10-08 20:38:57 +01:00
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 运行一个 JavaScript 文件:
|
2020-10-08 20:38:57 +01:00
|
|
|
|
|
|
|
|
|
`node {{文件名}}`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 开始一个 REPL 交互式解释器:
|
2020-10-08 20:38:57 +01:00
|
|
|
|
|
|
|
|
|
`node`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 执行输入的 JavaScript 代码:
|
2020-10-08 20:38:57 +01:00
|
|
|
|
|
|
|
|
|
`node -e "{{代码}}"`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 执行输入的 JavaScript 代码并显示结果:
|
2020-10-08 20:38:57 +01:00
|
|
|
|
|
|
|
|
|
`node -p "{{代码}}"`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 启动检查器并在程序源码解析完成后等待调试器连接:
|
2020-10-08 20:38:57 +01:00
|
|
|
|
|
|
|
|
|
`node --no-lazy --inspect-brk {{文件名}}`
|