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?
gitignore file, then npm will ignore the stuff matched by the . gitignore file. If you want to include something that is excluded by your . gitignore file, you can create an empty .
The --ignore-scripts argument will cause npm to not execute any scripts defined in the package. json. See scripts . The --legacy-bundling argument will cause npm to install the package such that versions of npm prior to 1.4, such as the one included with node 0.8, can install the package.
TL;DR there is no difference. It's just a shortcut for npm tests which run the test command in the package. json file. npm run test performs the same action in this case.
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 allowlist what they want published in their package.json
files
setting:
https://github.com/senchalabs/connect/blob/master/package.json
https://github.com/strongloop/express/blob/master/package.json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With