Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/uki00a/carol
- Owner: uki00a
- License: mit
- Created: 2020-05-24T07:25:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-13T11:54:11.000Z (12 months ago)
- Last Synced: 2024-10-23T12:16:45.363Z (2 months ago)
- Topics: deno, deno-module, gui
- Language: TypeScript
- Homepage: https://deno.land/x/carol
- Size: 161 KB
- Stars: 76
- Watchers: 4
- Forks: 6
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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.