Skip to content

Deno notes

Deno is JavaScript for the serverless era.

HTTP server

Examples using the HTTP server from the built in Deno standard library.

import { serve } from "";



This can be extended to render from JSX by including Preact and preact-render-to-string.

Note that some examples use a .jsx or .tsx file extension, so Deno Deploy knows to interpret a given file as JSX/TSX.

Nano JSX

Another option is to use Nano JSX as shown in this example:

Nano SSR

Website in a single file

This example uses nanossr, which is a tiny server-side renderer that uses Nano JSX with twind under the hood for styling.

ESM modules

A fast, global content delivery network for NPM packages with ES Module format.

Deno 1.30 now has built-in Node modules.

node: URLs are supported as an alternative means to load Node.js builtin modules. This URL scheme allows for builtin modules to be referenced by valid absolute URL strings.

import { readFileSync } from "node:fs";


Installation docs

Add to PATH by editing .bashrc and add the two lines as mentioned when the installation finishes.

vi .bashrc

Check the verion

deno -V
deno --version

To upgrade:

deno upgrade

Extension: Deno for Visual Studio Code


A multi-datacenter websockets-based chat, client+server in 23 lines of code on Deno Deploy.

Explanation of the above code