- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个可执行文件 myutil.exe
,我从我的 nodejs 模块调用它来执行一些功能。我希望将它打包,将我的 NodeJS 模块发布到 npmjs.com,并且在这个 Windows 平台上使用时,可执行文件应该是这个 nodejs 库的一部分,因为我的 nodejs 代码调用可执行文件来执行一个功能。我已经从 nodejs 运行了这个命令行二进制文件。
如何做到这一点以及如何最好地将这个可执行二进制文件包含在其中?它应该以某种方式托管在包之外吗?
另请注意,这只是一个限制,此时它必须是 Windows 上的可执行文件,或者由于其中代码的性质,它必须是 Linux 系统上的可运行二进制文件,不能是 DLL/库。稍后也许我可以将它的一些代码移动到 DLL/库中。
最佳答案
supply a
bin
field in yourpackage.json
which is a map of command name to local file name. On install, npm will symlink that file intoprefix/bin
for global installs, or./node_modules/.bin/
for local installs.
例如,如果您在 package.json
中有这个,并在全局安装了您的包,则命令 npmputty
将在 PATH 中可用。
"bin": {
"npmputty": "./bin/putty.exe"
},
如果你不想在包中发布这个可执行文件,可以实现 postinstall
script从 github.com 之类的地方下载它。
{
"scripts" : {
"postinstall" : "scripts/download_from_github.js"
}
}
关于node.js - 发布到 npmjs.com 时分发带有 nodejs 模块的二进制可执行文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67766855/
我目前正在为一组非常异构的计算机开发 OpenCL 应用程序(具体使用 JavaCL)。为了最大限度地提高性能,如果 GPU 可用,我想使用它,否则我想回退到 CPU 并使用 SIMD 指令。我的计划
我尝试使用以下链接为我的示例应用程序创建 OTA: http://developer.apple.com/library/ios/#featuredarticles/FA_Wireless_Enter
使用 gradle 发行版插件创建发行版时是否可以添加空目录(例如“日志”)? 我看到了this JIRA ,描述完全相同的事情。仍然开放https://issues.gradle.org/brows
我在网上看到,如果我们想将应用程序分发到应用程序商店,我们需要一个单独的分发配置文件。我知道 StackOverflow 上已经有针对此错误的答案,但我认为我的答案与我的分发配置文件有关。 所以现在我
我想为 existing bundle id 创建新的 IOS Provisioning profile 但它给我一个错误。请帮忙 我创建同名的IOS 但管理员做了一些事情并使其无效。现在他为我创建了
要么我疯了,要么没有人喜欢/喜欢这个功能,但很久以前我曾经在 sourceforge 系统中使用 subversion。我有能力为完成的提交创建完整的文件补丁。 无论如何,我无法弄清楚如何在 git
以不需要客户手动安装 Ruby 和所需 Gem 的方式向客户分发简单的命令行 Ruby 应用程序的最佳方式是什么? 根据我的理解,这个任务归结为几行 SH/BAT 代码,这些代码执行 Ruby/Gem
我有一个依赖于多个库的 Java 项目,这些库作为 JAR 文件分发。当我构建我的项目时,我最终得到了 myProject.jar 和一个 lib 文件夹,其中包含我使用的每个库的 JAR 文件。 为
编辑:更新了问题,因为我很困惑 .dist-id与 .id ; 我正在尝试卸载 dist,但是当我通过 Distribution 时至 .uninstall看起来它的计算方式不同 .dist-id和
我正在考虑移动一个当前嵌入 Python 解释器的程序以使用 Lua。使用 Python 相当容易使用 modulefinder , compileall , 和 zipfile制作一个包含所有使用的
我的老板想要为特定客户分发该应用程序,该客户的员 worker 数约为 500 人。该应用程序使用 Web 服务和设备的 UDID 来限制其他用户访问该软件。我们不是一个可以注册企业程序的大公司,尤其
我正在使用临时分发来运行 Beta 测试程序,并且在分发应用程序更新时遇到了一些问题。我能够通过临时分发在设备上获取应用程序更新的唯一方法是先从设备中删除应用程序,然后安装更新。这为 Beta 测试人
我的公司最近开始为各种客户开发定制 iPhone 应用程序。我们遇到的挑战之一是如何将这些应用程序提供给客户,以便他们可以在开发过程中对其进行审查。 理想情况下,只需向他们发送应用程序文件并让他们将其
我正在使用 SDWebImage 开源项目来异步加载图像。我可以为模拟器以及我的本地设备构建和运行。但是,当我尝试构建分发(即存档)时,编译器似乎不理解头文件是什么: 导入“UIImageView+W
我的应用程序依赖于 DBGHELP.DLL 函数,尤其是有关目标进程加载的 DLL 的信息。然而,很多时候它在低于 Vista 的 Windows 版本上失败(你知道 XP 仍然存在!)。环顾四周,发
tl;博士 大约一周前,我为我的第一个重要的 Haskell 项目发布了 0.1.0.0 包。我希望可执行文件易于安装和升级,即使对于非 Haskellers 也是如此。在 the README 中,
我刚刚完成 Erlang 实践截屏视频(代码 here ),并且有一些关于分发的问题。 这是整体架构: 以下是监督树的样子: 阅读Distributed Applications让我相信主要动机之一是
我是 iPhone 世界的新手。 我开发了一个应用程序,我想将其发送到特定 wi-fi 接入点附近的所有 iphone。 (它适用于购物中心) 据我所知,由于我在这方面的知识有限,我无法通过我的网络服
我使用 Netbeans 创建了一个 Java 控制台应用程序。在 Netbeans dist 目录中,我有该项目的类文件。现在我需要将可执行文件提供给其他人谁将在另一台电脑上运行它们。 我应该发送哪
我正在考虑使用 IronPython 开发一个小型应用程序,但是我想将我的应用程序分发给非技术人员,因此理想情况下我希望能够为他们提供我的应用程序的标准快捷方式以及他们需要的说明首先安装 IronPy
我是一名优秀的程序员,十分优秀!