Deno Deploy Demo: a multi-datacenter chat, client+server in 23 lines of TS
dash.deno.com
dash.deno.com
I expect the demo works with or without the await on the listen promise because the listen code runs regardless (and prevents main from exiting).
Native typescript, easy-as-pie dependency management. its great!
DNS wasn't created with security in mind, so to say Deno is secure because it uses a permissions system while relying directly into DNS for imports to me sounds weird.
But with deno, if you’ve just accidentally installed some malicious squatters’ package that mimics the one you meant to use, at least you’ve got less exposure because the malicious code won’t necessarily have blanket permissions to make network calls, read files, etc. virtually any other language/package management system cannot say the same.
deno will download and cache the dependencies you import, they’re right in the project folder vs buried in a sea of node_modules. It’s super convenient to look at and inspect, if there’s any doubt or idle curiosity.
update: the original version was too spammy, i have changed it so that pepe only responds to greetings or when you type "pepe"
update 2: i have throttled pepe so it only comes back after minute of cooldown
class BroadcastChannel
return `system('ircd')`
end
Only three lines! :DI suppose this is not limited to multiple datacenters, but to multiple script instances in one datacenter as well.
CloudFlare: global, huge company who regrets they don't already route 100% of internet traffic
Edit: I should add, I commend both efforts, both probably improve the world more than they hurt it, just injecting a bit of humor.
> At a high level, Deno converts TypeScript (as well as TSX and JSX) into JavaScript. It does this via a combination of the TypeScript compiler, which we build into Deno, and a Rust library called swc. When the code has been type checked and transformed, it is stored in a cache, ready for the next run without the need to convert it from its source to JavaScript again.
>Deno can run JavaScript or TypeScript out of the box with no additional tools or config required.
- https://deno.land/manual@v1.15.3/examples/hello_world
>Deno is a runtime for JavaScript/TypeScript which tries to be web compatible and use modern features wherever possible.
- https://deno.land/manual@v1.15.3/getting_started/first_steps
You can run any of their examples to see that `deno run` commands can execute typescript without requiring a separate transpilation step
No hard feelings though, context is important and many of us miss it at times :)
https://deno.land/manual@v1.15.3/typescript/overview#how-doe...
I can see how you can get confused, even if I wasn't as I'm around the JS community.
Just saying because TS had some kind of popularity these days.