Creating a node application with TypeScript and ts-node

ts-node is a package that allows you to run TypeScript (.ts) files without a build step.

You can run a TypeScript project with:

ts-node src/index.ts

You can combine ts-node with nodemon to restart the application on code changes:

nodemon --watch src/**/*.ts --exec ts-node src/index.ts

You can have your tests coded in TypeScript. You might need to add this on tsconfig.json:

"include": ["**/*.ts"]

And then you will be able to run the tests with:

mocha --compilers ts:ts-node/register,tsx:ts-node/register spec/**/*.ts

You can use a gulpfile.ts and have it run by just calling gulp:

gulp
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade