Carol is a deno module to build desktop applications using Deno, HTML, and Google Chrome. This module is a port of carlo to Deno.
- Deno🦕
- Google Chrome (Carol uses locally-installed Google Chrome to provide UI.)
hello.ts
import{launch}from"https://deno.land/x/carol/mod.ts";import{dirname,fromFileUrl,join}from"https://deno.land/std/path/mod.ts";constapp=awaitlaunch({title: "Hello Deno!",width: 480,height: 320,});app.onExit().then(()=>Deno.exit(0));awaitapp.exposeFunction("greet",(name: string)=>`Hello, ${name}!`);constfolder=join(dirname(fromFileUrl(import.meta.url)),"public");app.serveFolder(folder);// Serve contents from "./public" folderawaitapp.load("index.html");public/index.html
<html><body><div>Hello, Deno!</div><script>window.onload=async()=>window.alert(awaitwindow.greet("Deno"));</script></body></html>Run hello.ts from the CLI:
# If you are using Windows, you additionally need `--allow-env`!
$ deno run --allow-read --allow-write --allow-run --allow-net hello.ts