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?
I started HTML and CSS on Myspace! I love teaching and solving difficult problems. I really enjoy using frameworks but I love the challenge of rolling your own. I try VanillaJS until I need more.
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 onts-node
.For example, when I want to create a CLI script (
"bin"
field inpackage.json
).Furthermore, as I use Node 10, I cannot use
import
as well, onlyrequire
, but this shouldn't be a problem, is it?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.