mirror of
https://github.com/goldbergyoni/nodebestpractices.git
synced 2025-10-27 10:55:55 +08:00
Update wraputilities.md
This commit is contained in:
@ -4,16 +4,11 @@
|
||||
|
||||
|
||||
### One Paragraph Explainer
|
||||
Once you start growing and have different components on different servers which consumes similar utilities, you should start managing the dependencies - how can you keep 1 copy of your utility code and let multiple consumer components use and deploy it? well, there is a framework for that, it's called NPM... Start by wrapping 3rd party utility packages with your own code to make it easily replaceable in the future and publish your own code as private NPM package. Now, all your code base can import that code and benefit free dependency management framework. It's possible to publish NPM packages for your own private use without sharing it publicly using private modules, private registey or [local NPM packages](https://medium.com/@arnaudrinquin/build-modular-application-with-npm-local-modules-dfc5ff047bcc)
|
||||
Once you start growing and have different components on different servers which consumes similar utilities, you should start managing the dependencies - how can you keep 1 copy of your utility code and let multiple consumer components use and deploy it? well, there is a framework for that, it's called NPM... Start by wrapping 3rd party utility packages with your own code to make it easily replaceable in the future and publish your own code as private NPM package. Now, all your code base can import that code and benefit free dependency management framework. It's possible to publish NPM packages for your own private use without sharing it publicly using [private modules](https://docs.npmjs.com/private-modules/intro), [private registry](https://npme.npmjs.com/docs/tutorials/npm-enterprise-with-nexus.html) or [local NPM packages](https://medium.com/@arnaudrinquin/build-modular-application-with-npm-local-modules-dfc5ff047bcc)
|
||||
|
||||
|
||||
<br/><br/>
|
||||
|
||||
|
||||
### NPM as the engine for reusable components
|
||||
### Sharing your own common utilities across environments and components
|
||||

|
||||
|
||||
<br/><br/>
|
||||
|
||||
### Example: wrapping your logger as NPM package
|
||||

|
||||
|
||||
Reference in New Issue
Block a user