Normally in node files I just put
#!/usr/bin/env node
at the top and make it executable to create a file that can be run from a bash terminal.
If you have TypeScript and ts-node installed globally:
npm install typescript ts-node -g
You can now easily do this with:
#!/usr/bin/env ts-node console.log('Hello world')