DEV Community

Ben Duncan
Ben Duncan

Posted on

Try out Deno on Repl.it πŸŽ‰

πŸ’‘ Disclaimer: I have nothing to do with Repl.it or Deno.
I'm just spreading the good news!

You can now try Deno in the browser on Repl.it!

To give it a shot, go to the link above and try pasting in some Deno, and click Run at the top.

I wrote a quick example that uses Typescript types (ms: number) and and async/await:

/** Build a promise to wait for `ms` milliseconds */
const sleep = (ms: number) => new Promise(res => setTimeout(res, ms))

/** Count seconds from 1-10 */
void (async () => {
  let x = 0
  while (x < 10) {
    x++
    console.log(x)
    await sleep(1000)
  }
})()
Enter fullscreen mode Exit fullscreen mode

As a bonus, Repl.it also supports intellisense using Typescript types and docblock comments. You can see below how it has picked up the signature and description of the sleep function when I hover over it:

Alt Text

Top comments (0)