DEV Community

Discussion on: So, your friends hate Typescript. Using Typescript without using Typescript.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

Thanks. This might come in handy when I want to run node ./script.js, but I want to skip the compilation step for TypeScript, nor do I want to rely on ts-node.

For example, when I want to create a CLI script ("bin" field in package.json).

Furthermore, as I use Node 10, I cannot use import as well, only require, but this shouldn't be a problem, is it?

Collapse
 
mandrewdarts profile image
M. Andrew Darts • Edited

Definitely, that would be a good use case!

Using require shouldn't be a problem.

I love using this approach when I want to avoid a build step altogether.

I really appreciate you taking the time to check this out.