Is it a bad practise to use ts-node in production?

According to Blake Embrey, the author of ts-node, you can use it in production BUT you should use it with the --transpile-only flag.

Example:

ts-node --transpile-only ./src/start.ts

If you are compiling with transpile only, it will have a lower memory footprint as no type information will be generated. However, it can come to problems when you are using reflect-metadata (with experimental support for decorators).

In short: Use ts-node --transpile-only (there is also ts-node-transpile-only) in production when you are not using reflect-metadata. Otherwise, use tsc in combination with classic node.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)