My module has no dependency on its own but for running tests you need to install
jasmine-node module. Should I include that module as a dependency?
Most package management systems have a special way of specifying dependencies that are needed only for the development. Python's
leiningen has profiles, and
devDependencies: see docs.
devDependencies is exactly what you are looking for. However, if this is a package that you only occasionally need, you can use something else.
My npm package is
install-subset, and can be installed globally with
npm install -g install-subset
First, you build whitelists and blacklists for named install subsets in your package.json like this:
Then call it with, for example,
This will temporarily rewrite your package.json to not install those packages blacklisted, then restore it, which depending on the packages can save a lot of time and bandwidth.