The devDependencies section of npm's package.json documentation says to list your test dependencies there so that users of your package don't have to pull down extra dependencies. Would it make sense to also add my test directory to .npmignore in that case?
.npmignore
Yes that's what most people do, here are some npmignore files for popular Node.js modules:
https://github.com/socketio/socket.io/blob/ab46351a8446516fb4eea3b8333f7c0f18afaac5/.npmignore
Other people whitelist what they want published in their package.json files setting:
package.json
files
https://github.com/senchalabs/connect/blob/master/package.json https://github.com/strongloop/express/blob/master/package.json
1.4m articles
1.4m replys
5 comments
57.0k users