Skip to content

uki00a/carol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3c7e212 Â· Jul 28, 2022

History

91 Commits
Jul 28, 2022
Mar 14, 2021
May 30, 2021
Jul 28, 2022
Dec 23, 2020
Jan 30, 2022
Dec 26, 2020
May 24, 2020
Jan 31, 2022
Jan 31, 2022
Jan 31, 2022
May 30, 2021
Mar 28, 2022
Jul 28, 2022
Mar 28, 2022
May 30, 2021
Sep 23, 2021
May 24, 2020
Jan 31, 2022
Dec 26, 2020
Sep 23, 2021
Jan 30, 2022
Jan 31, 2022
Dec 27, 2020
Sep 23, 2021

Repository files navigation

Carol

Build Status https://img.shields.io/github/tag/uki00a/carol.svg license deno doc nest badge

Carol is a deno module to build desktop applications using Deno, HTML, and Google Chrome. This module is a port of carlo to Deno.

Requirements

  • Deno🦕
  • Google Chrome (Carol uses locally-installed Google Chrome to provide UI.)

Examples

hello.ts

import { launch } from "https://deno.land/x/carol/mod.ts";
import { dirname, fromFileUrl, join } from "https://deno.land/std/path/mod.ts";

const app = await launch({
  title: "Hello Deno!",
  width: 480,
  height: 320,
});

app.onExit().then(() => Deno.exit(0));

await app.exposeFunction("greet", (name: string) => `Hello, ${name}!`);
const folder = join(dirname(fromFileUrl(import.meta.url)), "public");
app.serveFolder(folder); // Serve contents from "./public" folder
await app.load("index.html");

public/index.html

<html>
<body>
  <div>Hello, Deno!</div>
  <script>
    window.onload = async () => window.alert(await window.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

Links

License

  • This module contains code adopted from the following projects. They have preserved their individual licenses and copyrights.
  • Additional work with this module is licensed under the MIT license.