shelljs 执行 npm 模块的 shell 脚本部分

shelljs to execute a shell script part of npm module

我正在创建一个基于 nodejs 的小 cli。我需要的是能够调用 shell 脚本,这是我的 npm 模块的一部分(推送到 npm 注册表)。

我正在查看 shelljs,我发现它可以从文件系统执行脚本。但是我正在看 shell.execute(require('./execute.sh')).

之类的东西

有没有办法做到这一点

最终使用 get-installed-path 到包中 shell 脚本的路径。