Put optional deps under optionalDeps, test deps under devDeps. #31

merged 1 commit into from Sep 26, 2012


None yet

2 participants


From https://npmjs.org/doc/json.html:


If someone is planning on downloading and using your module in their program, then they probably don't want or need to download and build the external test or documentation framework that you use.

In this case, it's best to list these additional items in a devDependencies hash.

These things will be installed whenever the --dev configuration flag is set. This flag is set automatically when doing npm link, and can be managed like any other npm configuration param. See config(1) for more on the topic.


If a dependency can be used, but you would like npm to proceed if it cannot be found or fails to install, then you may put it in the optionalDependencies hash. This is a map of package name to version or url, just like the dependencies hash. The difference is that failure is tolerated.

It is still your program's responsibility to handle the lack of the dependency.

@lorenwest lorenwest merged commit 95d0e6c into lorenwest:v0.4.16 Sep 26, 2012

Thanks for noticing this and making the change.


Just saw that this went to v0.4.16 instead of master, is that what you wanted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment