You can download the full repo (and not just the lib folder) into your application under a folder called node_modules .
Once you do this, your require will be simple:
var multipart = require('multipart');
This is due to the way node resolves module dependencies. It will always look for the node_modules directory in the root of your application (and a few other places).
It is important that you download the complete repo, not just the lib folder, if you plan to use it this way, since the package.json file is used to find the main entry point.
{ "name" : "multipart" , "version" : "0.0.0" , "description" : "A JavaScript library for parsing and writing multipart messages" , "contributors" : [ "Isaac Z. Schlueter <i@izs.me>" , "John Wright <mrjjwright@gmail.com>" ] , "repository" : { "type" : "git" , "url" : "http://github.com/isaacs/multipart-js.git" } , "main" : "lib/multipart" }
The advantage of this is compatibility using npm install locally on your dev machine.
You can also download the github tar file. Click the Download button and deploy it using your application. Once this is done on your server, you can run
npm install <path-to-the-tar-file>
This will install multipart on the machine for you.
theprogrammer Aug 17 2018-11-18T00: 00Z
source share