Situation
I often see Node.js applications with the following structure:
General pattern:
lib/ or src/ - self-written codeindex.js - main code- internal modules ... (for example, written independently for this project)
node_modules- external modules ... (for example, taken from another project)
package.json
My problem
What I don't like about this template:
My idea
Therefore, I think it would be nice to also place the internal modules in the node_modules folder (somewhere in the project). This way, node can find them even if you do not explicitly specify the path.
For instance:
src/ - self-written codeindex.js - main codenode-modules - for internal
node_modules - for external- external modules ... (for example, taken from another project)
package.json
My question
- Are there any flaws in my plan?
- Is there any other idea where to place the internal modules in the folder structure?
Thanks for your reply (or comment). - If something is unclear, comment.
source share