I love Bundler, it\'s great at dependency management. I love npm, installing node packages is easy! I have a nodejs app and would love to be able to specify my apps de
It was quite difficult to figure this out, but NPM makes this possible.
deps/
)package.json
file in the above directory that lists dependenciesindex.js
file in the above directory that requires your dependenciesImagine that express is your only dependency
note: Increment the version # each time you modify the dependencies
{
"name": "myapp_dependencies",
"version": "0.0.1",
"engines": {
"node": "0.4.1"
},
"dependencies":{
"express": "2.0.0beta2"
}
}
export.modules = {
express: require('express')
//add more
}
Now you should be able to install your dependencies using npm. You could even make this part of your deployment process
cd deps
npm install
Then within your app code you can get access to your specific version of express like this:
var express = require('myapp_dependencies').express;