This is a basic TypeScript/Node.js setup.
- Node.js
- npm (Node Package Manager)
- Clone the repository:
git clone https://github.com/fedemerino/node-typescript-setup.git- Navigate to the project directory:
cd node-typescript-setup- Install the dependencies.
npm installnpm run devRuns the application in development mode usingts-node-dev.npm run startRuns the application in production mode usingts-node.npm run tscCompiles the TypeScript code to JavaScript.
.
├── src
│ └── index.ts
├── package.json
├── tsconfig.json
└── README.md
To run the application in development mode, use:
npm run devTo compile the TypeScript code to JavaScript, use:
npm run tscTo run the application in production mode, use:
npm run start