npm - How to organize a large single repo node.js app -


i have node.js app using single git repo, has various packages. trying make things modularized, , separate.

├── common │   └── formattr │       ├── node_modules │       ├── package.json │       └── formattr.js └── providers     ├── aws     │   ├── node_modules     │   └── package.json     └── google         ├── node_modules         └── package.json 

the problem running when clones app, have recurse each package direction , manually run npm install. additionally, there lots of wasted resources , duplication, since package aws might use npm install request google package. right now, both store independ versions.

finally, there problem well:

// inside of aws package, need formattr. makes me cry inside. let format = require('../../common/formattr/formattr'); 

what recommended pattern , structure?


Comments