It’s okay. However, Electron is actually useless in this case, because the command line interactive output mainly relies on stdout output, not the HTML rendering result. It would be better to use Node.js directly. process.argv is the command line parameter, the first two are the electron command and main.js. var options = process.argv.slice(2); You need to execute it manually instead of using npm. node_modules/.bin/electron main.js argv1 argv2 Process commands in main.js.
electron
is used to build desktop applications.If you want to run it under the
console
oflinux
, don’t uselinux
的console
下跑起来,就不要使用electron
,直接用node.js
, just usenode.js
directly?It’s okay. However, Electron is actually useless in this case, because the command line interactive output mainly relies on stdout output, not the HTML rendering result. It would be better to use Node.js directly.
process.argv is the command line parameter, the first two are the electron command and main.js.
var options = process.argv.slice(2);
You need to execute it manually instead of using npm.
node_modules/.bin/electron main.js argv1 argv2
Process commands in main.js.