You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
README.md contains the example require('minimist')(process.argv.slice(2));.
That, of course, is correct for the many people developing plain node applications.
But on Electron (which is a big platform) developers need to be a bit careful because there it depends on how the app is ran to determine how many arguments to slice off. There (but only there!) something likerequire('minimist')(process.argv.slice(process.defaultApp ? 2 : 1)); would be wise to use.
Should this be mentioned?
The text was updated successfully, but these errors were encountered:
That seems like one of those universal things that an electron developer has to know - and usually those aren’t documented anywhere but with electron (in this example)
Ah, one more detail: I switched from yargs to minimist because I didn't need all the bells and whistles of the former. yargs does have this functionality out of the box. This is one of the reasons it lead me to this pitfall (another being that this likely does not happen during the initial development).
I think it is correct that minimist does not do this automatically like yargs, as this really is a special case. I just thought it might be common enough, that you might would like to mention it.
It can't hurt, I suppose - although electron is a pretty uncommon use case overall, I'd expect (it gets 600K downloads a week, this package gets 50M, to put it in perspective).
README.md
contains the examplerequire('minimist')(process.argv.slice(2));
.That, of course, is correct for the many people developing plain node applications.
But on Electron (which is a big platform) developers need to be a bit careful because there it depends on how the app is ran to determine how many arguments to slice off. There (but only there!) something like
require('minimist')(process.argv.slice(process.defaultApp ? 2 : 1));
would be wise to use.Should this be mentioned?
The text was updated successfully, but these errors were encountered: