Data Transfer Objects (DTOs) to carry data between frontend and backend processes.
npm install @royalinvest/dtoThis project contains shared NPM packages for RoyalInvest (e.g., DTOs, utilities).
Packages are written in TypeScript and published to the company’s NPM organization.
---
To authenticate with the NPM registry, configure your .npmrc file:
``bash`
npm config set //registry.npmjs.org/:_authToken=
Replace with a token from npmjs.com.
For access to the company’s account, request a token from the administrator.
---
You can view all published packages here:
RoyalInvest NPM Packages
---
1. Create a new directory under npm-package/.package.json
2. Add:
- (copy structure from dto/package.json).tsconfig.json
- (same as in existing packages).src/
3. Implement your code in .
Each package should follow the same conventions for consistency.
---
Run the build command inside the package directory:
`bash`
npm run build
Check the scripts section in dto/package.json for an example configuration.
---
We follow Semantic Versioning (SemVer):
- MAJOR – incompatible API changes
- MINOR – add functionality in a backward-compatible manner
- PATCH – backward-compatible bug fixes
Update the version number manually in package.json before publishing.
---
To publish a package to the NPM registry:
`bash``
npm publish --access public