Skip to content
This repository has been archived by the owner on Jul 31, 2022. It is now read-only.

2nthony/webview-rs

Repository files navigation

webview-rs

Rust webview for Node.js.

Install

npm i webview-rs

Usage

const { createWindow } = require("webview-rs");

const html = `
<!DOCTYPE html>
<html>
  <head>
    <style>
      body {
        text-align: center;
      }
    </style>
  </head>

  <body>
    <h1>Webview RS for Node.js</h1>
    <button onclick="sayhi()">Say hi</button>

    <script>
      function sayhi() {
        alert("hi from webview rs");
      }
    </script>
  </body>
</html>
`;

createWindow({
  title: "Webview rs",
  width: 400,
  height: 600,
  content: html,
});

TODOs

  • Support parsing a URL to present content(PR welcome)

Tests

  • macOS 12.1 with intel i5
  • Any Windows

Credits

Contributes

PRs welcome!

License

MIT © 2nthony