UPDATE
See "Run TypeScript in Node without extensions" as of Dec 10, 2024. (5 months later)
You might have heard that Node now has watch mode. It watches the files you're saving and re-runs the node
command automatically. Example:
// example.js
function c2f(c) {
return (c * 9) / 5 + 32;
}
console.log(c2f(0));
Now, run it like this:
❯ node --watch example.js 32 Completed running 'example.js'
Edit that example.js
and the terminal will look like this:
Restarting 'example.js' 32 Completed running 'example.js'
(even if the file didn't change. I.e. you just hit Cmd-S to save)