官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 唐山市| 炎陵县| 和田市| 哈密市| 武功县| 天全县| 佳木斯市| 曲沃县| 平安县| 大悟县| 香港| 克山县| 陇川县| 芮城县| 彭州市| 巩留县| 资溪县| 塔城市| 徐水县| 宁都县| 黔江区| 永寿县| 玛沁县| 台南市| 车致| 泰顺县| 邹平县| 三门峡市| 剑河县| 柯坪县| 尚义县| 阿瓦提县| 寿光市| 万源市| 临清市| 睢宁县| 黄大仙区| 察隅县| 万安县| 扎鲁特旗| 运城市|