You can download the full repo (not just the lib folder) into your application under a folder with the name node_modules
.
Once you do that, your require
will just be:
var multipart = require('multipart');
This is due to the way node resolves module dependencies. It will always look for a node_modules
directory at the root of your app (and a few other places as well).
It's important you download the full repo and 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 <[email protected]>"
, "John Wright <[email protected]>"
]
, "repository" :
{ "type" : "git"
, "url" : "http://github.com/isaacs/multipart-js.git"
}
, "main" : "lib/multipart"
}
The advantage of this is compatibility with using npm install locally in your dev machine.
You can also download the tar file form github. Hit the Download button and deploy that with your app. Once that is done in your server you can run
npm install <path-to-the-tar-file>
That will install multipart
on the machine for you.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…