- Mastering Node.js(Second Edition)
- Sandro Pasquali Kevin Faaborg
- 179字
- 2021-07-02 19:28:39
Flags
There are a number of settings available to you for manipulating the Node runtime. Try this command:
$ node -h
In addition to standards such as --version, you can also flag Node to --abort-on-uncaught-exception.
You can also list the options available for v8:
$ node --v8-options
Some of these settings can save the day. For example, if you are running Node in a restrained environment like a Raspberry Pi, you might want to limit the amount of memory a Node process can consume, to avoid memory spikes. In that case, you might want to set the --max_old_space_size (by default ~1.5GB) to a few hundred MB.
You can use the -e argument to execute a Node program as a string; in this case, logging out of the version of V8 your copy of Node contains:
$ node –e "console.log(process.versions.v8)"
It's worth your time to experiment with Node/V8 settings, both for their utility and the path, to give you a slightly stronger understanding of what is happening (or might happen) under the hood.
- 解析QUIC/HTTP3:未來互聯網的基石
- MERN Quick Start Guide
- Hands-On Full Stack Development with Spring Boot 2 and React(Second Edition)
- 互聯網基礎資源技術與應用發展態勢(2021—2023)
- Spring Cloud微服務架構進階
- PLC、現場總線及工業網絡實用技術速成
- React:Cross-Platform Application Development with React Native
- Wireshark網絡分析就這么簡單
- CCNP TSHOOT(642-832)認證考試指南
- Building Web Applications with ArcGIS
- 園區網絡架構與技術
- LwIP應用開發實戰指南:基于STM32
- 物聯網與智慧農業
- 計算機通信網絡安全
- SEO攻略:搜索引擎優化策略與實戰案例詳解