@brcoding/common
v1.0.9
Published
1. Git Submodule : where we can create seprate repo for shared module and we can add it into any service by adding this as a submodule, but less version controlled. 2. NPM Package : best approach
Readme
Options for code sharing
- Git Submodule : where we can create seprate repo for shared module and we can add it into any service by adding this as a submodule, but less version controlled.
- NPM Package : best approach
NPM Package
- create organization into npm
- open package.json file and give appropriate name with "@{organization_name}/{name of the module}
- inside project
- git init
- git add .
- npm login
- npm publish --access public
Note:
when we are dealing with such things like writing in typescript but want javascript version of it, then inside your tsconfig.json uncomment delclaration and outdir, which will help us to build js version of it by running tsc command.
- We have added
pubscript inside package.json but this is not recommanded for real project do it manually for real project after thorough review, we are writing it to make our lives little bit easier for dev.
To update npm in any service we use
npm update --save @YOUR_ORG_NAME/common
or
npm install @YOUR_ORG_NAME/common@latest
Note - remember to replace YOUR_ORG_NAME with your actual NPM organization name.
