A new version of this is available. Please see here
To get an idea, watch Microsoft’s introductory video on the language.
The Full on explanation can be found here on StackOverflow
Working with TypeScript in Node.js
Many of us do not know how to use TypeScript in Node.js because it is a little complicated. But surprisingly, using TypeScript in Node.js is quite simple.
Working with TSC
npm install -g typescript @types/node tsc index.ts node index.js
There are a lot of ways and examples you can find by searching google for this specific problem. But this is my way of thinking.
You can find the full repository here.
Start by cloning the repository and installing the required npm modules.
git clone https://github.com/nisanthsojan/express-mongoose-typescript-starter.git embt cd embt nvm use npm install
This is a basic web application using Typescript, ExpressJS, Mongoose, and Bootstrap. Hosted in Heroku.
The live demo of the application link: https://embt-starter.herokuapp.com.
I have almost copied 90% of the ideas from the Sahat’s excellent Hackathon Starter project and converted it to my style.
The application which we get after the building is the bare bone modules and compiled pug template files which are required by the production server and not any other thing which is not required for the production server.
The admin page link can be accessed by navigating to ‘supervisor/entry’ and registration page can be accessed by ‘supervisor/register’.
The ‘src-server’ folder contains all the ExpressJS server application.
the ‘src-public’ contains all the client-side assets.
I will be improving this boilerplate template. Please do let me know in the comments and issuing any pull requests for any improvements/issues you can find.