3 ms·
I actually just started working on a new Node.js project that could get very large, and the first question I asked myself was... Do I want each npm package to b
by nodesocket 11y ago
I actually just started working on a new Node.js project that could get very large, and the first question I asked myself was... Do I want each npm package to be in a separate repo or use a single repo with deeply nested but discrete npm packages?
I decided to go with a single repo with lots of discrete NPM packages using NPM private. This allows for things like:
const logger = require('@org/utils.logger');
Which to me reads beautifully. The real only gotcha is remembering to run npm publish and npm install often. There is quite a bit of duplicate packages installed though. For example, almost all packages I write require lodash, so it is installed n number of times instead of just once globally at the root. But... I'm ok with that.
If each package was inside its own repo that increases complexity and costs (lots of private repos in GitHub) and I don't really see the benefit.