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

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.

主站蜘蛛池模板: 调兵山市| 颍上县| 鄂伦春自治旗| 赤峰市| 深泽县| 工布江达县| 车致| 德保县| 武平县| 霸州市| 改则县| 宜丰县| 酉阳| 上犹县| 邢台县| 义马市| 哈巴河县| 惠州市| 二连浩特市| 新竹市| 青阳县| 广元市| 南江县| 南汇区| 湛江市| 双桥区| 工布江达县| 贡嘎县| 石河子市| 赞皇县| 旅游| 临沧市| 府谷县| 大余县| 河曲县| 呼玛县| 四川省| 浪卡子县| 铜梁县| 阳信县| 吴江市|