Secure distribution of NodeJS applications

后端 未结 6 1002
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 03:21

What: Can NodeJS apps be distributed as binary? ie. you compile the .js app via V8 into its native binary, and distribute the binary to clients? (if you had

6条回答
  •  长情又很酷
    2020-11-28 04:01

    EncloseJS.

    You get a fully functional binary without sources.

    JavaScript code is transformed into native code at compile-time using V8 internal compiler. Hence, your sources are not required to execute the binary, and they are not packaged.

    Perfectly optimized native code can be generated only at run-time based on the client's machine. Without that info EncloseJS can generate only "unoptimized" code. It runs about 2x slower than NodeJS.

    Also, node.js runtime code is put inside the executable (along with your code) to support node API for your application at run-time.

    Use cases:

    • Make a commercial version of your application without sources.
    • Make a demo/evaluation/trial version of your app without sources.
    • Make some kind of self-extracting archive or installer.
    • Make a closed source GUI application using node-thrust.
    • No need to install node and npm to deploy the compiled application.
    • No need to download hundreds of files via npm install to deploy your application. Deploy it as a single independent file.
    • Put your assets inside the executable to make it even more portable. Test your app against new node version without installing it.

提交回复
热议问题