For the TypeScript enjoyers: you can do the same with Deno (and I'm sure Bun too, though I haven't done it).
#! /usr/bin/env -S deno run
You can add permission flags like this: #! /usr/bin/env -S deno run --allow-env --allow-read --allow-net