Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/uki00a/carol

A Deno port of carlo
https://github.com/uki00a/carol

deno deno-module gui

Last synced: about 2 months ago
JSON representation

A Deno port of carlo

Awesome Lists containing this project

README

        

# Carol

[![Build Status](https://github.com/uki00a/carol/workflows/ci/badge.svg)](https://github.com/uki00a/carol/actions)
![https://img.shields.io/github/tag/uki00a/carol.svg](https://img.shields.io/github/tag/uki00a/carol.svg)
[![license](https://img.shields.io/github/license/uki00a/carol.svg)](https://github.com/uki00a/carol)
[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/carol/mod.ts)
[![nest badge](https://nest.land/badge.svg)](https://nest.land/package/carol)

Carol is a deno module to build desktop applications using Deno, HTML, and
Google Chrome. This module is a port of
[carlo](https://github.com/GoogleChromeLabs/carlo) to Deno.

## Requirements

- DenoπŸ¦•
- Google Chrome (Carol uses locally-installed Google Chrome to provide UI.)

## Examples

**hello.ts**

```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

Hello, Deno!


window.onload = async () => window.alert(await window.greet("Deno"));

```

Run `hello.ts` from the CLI:

```shell
# If you are using Windows, you additionally need `--allow-env`!
$ deno run --allow-read --allow-write --allow-run --allow-net hello.ts
```

## Links

- [API Documentation](https://doc.deno.land/https/deno.land/x/carol/mod.ts)
- [carlo](https://github.com/GoogleChromeLabs/carlo)
- [lorca](https://github.com/zserge/lorca)

## License

- This module contains code adopted from the following projects. They have
preserved their individual licenses and copyrights.
- [carlo](https://github.com/GoogleChromeLabs/carlo)
- [lorca](https://github.com/zserge/lorca)
- Additional work with this module is licensed under the MIT license.