Skip to content

Latest commit

 

History

History
106 lines (77 loc) · 4.45 KB

README.md

File metadata and controls

106 lines (77 loc) · 4.45 KB

fibre-js

This directory provides JavaScript bindings for Fibre. Its home is located here. There's also a standalone repository for this directory here.

Current Status

So far fibre-js was only tested to run in Chrome but it should work in any browser that supports WebAssembly.

fibre-js currently supports the following transport providers:

NodeJS environments (incl Electron) are currently not supported due to issues with the WebUSB polyfill.

How to use

So you want your website to connect to some resource(s) using Fibre. Let's start with a simple HTML scaffolding.

<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>fibre-js Test</title>
    </head>
    <body>
        <h1 id="statusText">not connected</h1>
        <button id="connectBtn" disabled>Connect...</button>
    </body>
</html>

Now, right before the closing </body>, insert a script tag to load and open fibre-js:

<script type="module">
    import { fibreOpen } from './fibre.js';
    fibreOpen().then((libfibre) => {
        // fibre-js is ready to use!
    });
</script>

This will load the files fibre.js, libfibre-wasm.js and libf