@openfitnessprotocol/ofp 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -9
- package/core/ofp_core.asm.d.ts +2 -0
- package/core/ofp_core.asm.js +9694 -9694
- package/core/ofp_core.wasm +0 -0
- package/package.json +15 -8
- package/registry.d.ts +3 -0
package/README.md
CHANGED
|
@@ -21,11 +21,8 @@ New devices come with a new version of this package: no code of yours changes.
|
|
|
21
21
|
|
|
22
22
|
## Usage
|
|
23
23
|
|
|
24
|
-
Open Fitness Protocol for JavaScript apps: the OFP core and the four hooks an app wires up. No
|
|
25
|
-
dependencies.
|
|
26
|
-
|
|
27
24
|
```js
|
|
28
|
-
import { Ofp, wasmEngine } from '
|
|
25
|
+
import { Ofp, wasmEngine } from '@openfitnessprotocol/ofp'
|
|
29
26
|
|
|
30
27
|
const ofp = new Ofp({
|
|
31
28
|
engine: wasmEngine(wasmBytes), // or moduleEngine(...) where there is no WebAssembly
|
|
@@ -65,12 +62,12 @@ disconnectButton.onclick = () => ofp.release(id)
|
|
|
65
62
|
|
|
66
63
|
## The two forms of the core
|
|
67
64
|
|
|
68
|
-
Both are built by `scripts/build.sh` into `dist/`, with the registry bundle and this package
|
|
69
|
-
(`dist/ofp.js`, `dist/ofp.d.ts`):
|
|
70
|
-
|
|
71
65
|
| Runtime | Core | Engine |
|
|
72
66
|
|---|---|---|
|
|
73
|
-
| Node, Electron, browsers |
|
|
74
|
-
| React Native (Hermes has no WebAssembly) |
|
|
67
|
+
| Node, Electron, browsers | `@openfitnessprotocol/ofp/core/ofp_core.wasm` | `wasmEngine(bytes)` |
|
|
68
|
+
| React Native (Hermes has no WebAssembly) | `@openfitnessprotocol/ofp/core/js`, the same core as plain JavaScript | `moduleEngine(core)` |
|
|
69
|
+
|
|
70
|
+
Quick starts for Electron and React Native: https://openfitnessprotocol.org/developers. In the repository
|
|
71
|
+
both are built by `scripts/build.sh` into `dist/`.
|
|
75
72
|
|
|
76
73
|
`npm test` runs the same tests against both.
|