2

I recently started building a small project with TypeScript. It is a small application that runs some workflows based on received Webhook calls. This means that it exposes an Express app to handle these requests.

Currently I have an npm script that builds this project and transpiles it into JavaScript which can be then interpreted by Node.js. (The script runs: tsc --build --clean)

My question is, since this is not meant to be a library/package that will be published on NPM, is there any reason to transpile the project at all since I can just run it with ts-node?

I've been looking around for some information regarding this but couldn't find anything.

Are there any security, performance or any other implications when running the project directly with ts-node in a production environment instead of building it and running it with node?

1
  • 2
    In future, you can also consider Deno, a runtime that runs TypeScript natively Commented Feb 2, 2023 at 3:33

1 Answer 1

1

It depends on the size of your project. Most people transpile because it improves performance, consumes less system resources and provides more stability.

But in a small project this won't make much difference, so using ts-node may be sufficient.

Sign up to request clarification or add additional context in comments.

1 Comment

I see, since I'm planning to build a Docker image for this service as well, so I decided to build it nonetheless. But it's good knowing that it doesn't matter much for future projects. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.