How should the nodejs application packaged by electron be written so that it can be called directly from the command line after downloading from npm?

  node.js, question

It may not be clear.

That is, I now have an electron application (for example, ah), and then I want to publish it to npm.

But suddenly found that the usual operation is usedelectron-prebuiltCome on

You can’t pack itelectron-packagerAfter that, the things will be handed out. . .

How should I write to enable users tonpm i -g ahIt is then called directly from the command line inside.ahJust start this electron application?

My current solution is to change start’s script toelectron index.js. . .

Thank you ~

Just use your current method to solve it, use npm script.