This directory provides JavaScript bindings for Fibre. Its home is located here. There's also a standalone repository for this directory here.
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:
- WebUSB (Chrome and Edge only)
NodeJS environments (incl Electron) are currently not supported due to issues with the WebUSB polyfill.
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