Is it possible to automatically download the required modules for a node.js script? I\'m wondering if it\'s possible to generate a list of required modules for a node.js scr
Yes, there is a great piece of code called NPM for exactly this: https://npmjs.org/
You specify dependent packages in a package.json file (see the docs for syntax) and you can use npm install . to pull them in all at once, and then require them from your script.
Package.json syntax page: https://docs.npmjs.com/getting-started/using-a-package.json
The first time you install a module, your can provide any number of modules to install, and add the --save argument to automatically add it to your package.json
npm i --save dnode request bluebird
The next time, someone will execute npm i it will automatically install all the modules specified in your package.json