Make your NodeJS Typescript code Production Ready
Add Typescript To your existing project
npm install -g typescript
tsc -i– this will create tsconfig.json file
- Add following code into jsconfig.json file
Points to take note of
- Make sure that all of your typescript code that you want to convert to typescript is inside
- Start converting each file to typescript by renaming the extension to .ts and then convert the code to typescript.
- Once you have converted all the files to typescript remove set
Running Code in Production
- Once you are done with converting the code. Type
tscthis will convert the entire code in
- Now to run your code in production use the following command
pm2 start dist/app.js -i 0
Subscribe to our newsletter
'Jungleworks Entrepreneur's Den' to get access to the latest industry & product insights.