Coder Social home page Coder Social logo

vitaly-z / webview-bun Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tr1ckydev/webview-bun

0.0 0.0 0.0 95 KB

Bun bindings for webview, a tiny library for creating web-based desktop GUIs.

Home Page: https://www.npmjs.com/package/webview-bun

License: MIT License

TypeScript 100.00%

webview-bun's Introduction

webview-bun

bun bindings for webview

Webview is a tiny cross-platform library to make web-based GUIs for desktop applications.

Installation

Platforms supported: linux, macos-x64, macos-arm64

  • Install webkit2gtk dependency for linux.

    Ubuntu: sudo apt-get install libwebkit2gtk-4.0-dev

    Arch Linux: yay -S webkit2gtk

  • Install webview-bun and the latest compiled webview library from the releases of this repository.

    bun i webview-bun && bun node_modules/webview-bun/fetchLib.ts

Example

import { Webview } from "webview-bun";

const html = `
<html>
    <body>
        <h1>Hello from bun v${Bun.version} !</h1>
    </body>
</html>
`;

const webview = new Webview();

webview.setHTML(html);
webview.run();

For more examples, browse the examples folder of this repository.

Documentation

Refer to the comments in the source code for full documentation.

Development

Building

  • Clone the repository along with the webview submodule.

    git clone --recurse-submodules --remote-submodules https://github.com/tr1ckydev/webview-bun.git
  • Install bun-types and build the library for your platform

    bun i && bun run build

    or, fetch the latest compiled library from the releases of this repository.

    bun i && bun run postinstall

Running

To use your own built webview library, set the WEBVIEW_PATH environment variable with the path to your webview shared library file.

Run the following example to see it in action.

bun run examples/basic.ts

Credits

This repository is a direct port of webview_deno by @eliassjogreen with various changes to work with the bun runtime.

License

This repository uses MIT license. See LICENSE for full license text.

webview-bun's People

Contributors

tr1ckydev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.