This starter contains what you need to start developing nodejs
using typescript
.
A personal perference I have is to use lerna
for seperating to modules,
Even for smaller projects.
git clone [email protected]:gioragutt/node-ts-lerna-starter.git <project name>
cd <project name>
npm i
./create-package.sh main
This scripts handles the boilerplate of creating a new package.
The syntax is:
./create-package.sh [@my-scope/]package-name
This will create the following package:
packages/package-name
├── README.md
├── __tests__
│ └── package-name.test.js
├── lib
├── nodemon.json
├── package.json
├── src
│ ├── debug.ts
│ └── index.ts
└── tsconfig.json
tsc
: required to run the buildbuild
: build the project and output to thelib
directorystart
: run the modulestart:watch
: runs the module in watch mode, usingnodemon
src/debug.ts
- exposes a root logger, using thedebug
librarysrc/index.ts
- the main of the module. containshello world
code using adebug
logger.