-
Notifications
You must be signed in to change notification settings - Fork 296
Closed
Labels
Description
Hi,
- I wonder if there is a better way to pass NODE_OPTIONS to node cli. It turned out we need in production custom memory settings or good defaults (lowering resource usage).
So I find myself in writing long shebang lines for node.js scripts, e.g.
https://github.com/sematext/logagent-js/blob/master/bin/logagent.js#L1-L5
#!/bin/sh
':' //; export MAX_MEM="--max-old-space-size=100"; exec "$(command -v node || command -v nodejs)" "${NODE_OPTIONS:-$MAX_MEM}" "$0" "$@"
Is there something like .noderc, or interpretation of an environment variable like NODE_OPTIONS by the node executable to pass runtime options?
- Some people reported that options are given by option mames with underscore e.g.
--max_old_space_size=100
(Maybe on CentOS ...). How could I find out which naming scheme (dash vs. underscore) is used? - I ignore windows .. for now :)
BananaAcid