question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

config file node parameters

See original GitHub issue

How can I pass node arguments with a forever configuration file?

This is how I normally start

 node -nouse-idle-notification -expose-gc -max-old-space-size=8192 app.js port=5224

This is my config file, but adding in script or args doesn’t work.

 [
    {
      // App1
      "uid": "app1",
      "append": true,
      "watch": true,
      "script": "app.js",
      "args": ["port=5224"]
    },
    {
      // App2
      "uid": "app2",
      "append": true,
      "watch": true,
      "script": "app.js",
      "args": ["port=5225"]
    }
  ]

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
Redsandrocommented, Dec 19, 2015

I would also like to know how to configure --minUptime and --spinSleepTime in the .json file. They won’t stick and need to be passed as arguments to forever.

3reactions
jeffmcmahancommented, Jan 30, 2018

args is for passing arguments to your script. Use command to pass node flags, as in:

{
  "script": "index.js",
  "command": "node --experimental-modules"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating configuration files in Node.js using node-config
Node -config allows you to create configuration files in your Node application for different deployment environments. With it, you can define a ...
Read more >
How to store Node.js deployment settings/configuration files?
var nconf = require('nconf'); // First consider commandline arguments and environment variables, respectively. nconf.argv().env(); // Then load configuration ...
Read more >
How to Easily Set-up Node Config (Best Practices)
This guide shows 5 powerful node config best practices that you should follow. ... A config file can also export separate variables that...
Read more >
Node-config tutorial - creating configuration files for ... - ZetCode
Node config supports various configuration file formats, including JSON, YAML, properties, or XML. The default configuration file is default.
Read more >
config - npm
Node -config organizes hierarchical configurations for your app deployments. It lets you define a set of default parameters, and extend them ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found