将Node.js脚本+ node.exe打包到单个可执行文件中 [英] Packing Node.js-Scripts + node.exe into a single Executable

查看:455
本文介绍了将Node.js脚本+ node.exe打包到单个可执行文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为Node.js现在也可以在Windows上使用,所以我想共享我的脚本而不包含node.exe.是否可以将脚本(没有更多文件)与node.exe一起打包到一个可执行文件中?

Because Node.js now also available on Windows, I would like to share my scripts without including node.exe. Is it possible to pack the script (no more files) together with the node.exe into a single executable file?

推荐答案

您绝对可以,并且 JXcore .

一旦在Windows上安装了JXcore,则只需运行:

Once you have JXcore installed on windows, all you have to do is run:

jx package app.js "myAppName" -native

这将生成一个.exe文件,您可以分发该文件并在没有任何外部依赖项的情况下执行该文件(您甚至不需要系统上的JXcore或Node.js).

This will produce a .exe file that you can distribute and can be executed without any external dependencies whatsoever (you don't even need JXcore nor Node.js on the system).

以下是有关该功能的文档:

Here's the documentation on that functionality: https://github.com/jxcore/jxcore/blob/master/doc/api/jxcore-feature-packaging-code-protection.markdown

( https://stackoverflow.com/a/27551233/810830的副本)

这篇关于将Node.js脚本+ node.exe打包到单个可执行文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆