Search code examples
node.jsnpmnode-webkitnw.js

How to use npm package in nw.js without installing Node JS


I want to use this npm package(https://www.npmjs.com/package/node-ssh) in my nw.js application, In my dev system installed node js and installed this package and successfully its working , But while shipping this application I don't want to make a dependency to node js. Without installing the node js can nw.js use this package.

Any help ?


Solution

  • Use Gradle wrapper and the Gradle Plugin for Node.

    To avoid having to install gradle, I use Spring Initializr to create a simple project that has the gradle wrapper in it. Then I'll just copy the gradle folder, the gradlew and gradlew.bat. All that's left then is to create the .gitignore and build.gradle files.