How To Automatically Clean A Node_modules Directory For A SCM Commit
I am quite new with node.js. The feature of having my dependencies (from
node_modules) in the same directory that the one of my project suits me.
I also wants to commit those dependencies with my project.
I started with a project that uses
socket.io. But when I take a look at the directory generated by
npm after a
npm install socket.io, there are examples files, documentation, readme files, benchmark data, changelogs, ... Lots of files that I do not want to commit in my git or subversion system.
Is there an automatic tool that shrinks the content of a
node_modules directory to only keep what is needed?
If I read correctly the documentation of npm, I found nothing for that. There is a
prune option, but it is to remove the unused dependencies.
No, there is not tool to do that. Generally the author of the module uses
.npmignore to ignore any files which he doesn't want published. Examples, Docs, Readme, Changelogs are published by almost all authors.
The only way for you is to delete them and commit to git.
- → Maximum call stack exceeded when instantiating class inside of a module
- → Browserify api: how to pass advanced option to script
- → Node.js Passing object from server.js to external modules?
- → gulp-rename makes copies, but does not replace
- → requiring RX.js in node.js
- → Remove an ObjectId from an array of objectId
- → Can not connect to Redis
- → React: How to publish page on server using React-starter-kit
- → Express - better pattern for passing data between middleware functions
- → Can't get plotly + node.js to stream data coming through POST requests
- → IsGenerator implementation
- → Async/Await not waiting
- → (Socket.io on nodejs) Updating div with mysql data stops without showing error