Skip to content

Commit

Permalink
Format readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane committed May 15, 2023
1 parent 54abb28 commit 6e6fad5
Showing 1 changed file with 31 additions and 32 deletions.
63 changes: 31 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ npm install -g wasm-feature-detect

```html
<script type="module">
import { simd } from "wasm-feature-detect";
import { simd } from "wasm-feature-detect";
if (await simd()) {
/* SIMD support */
} else {
/* No SIMD support */
}
if (await simd()) {
/* SIMD support */
} else {
/* No SIMD support */
}
</script>
```

### Hotlinking from Unpkg

```html
<script type="module">
import { simd } from "https://unpkg.com/wasm-feature-detect?module";
// ...
import { simd } from "https://unpkg.com/wasm-feature-detect?module";
// ...
</script>
```

Expand All @@ -42,37 +42,36 @@ If required, there’s also a UMD version
```html
<script src="https://unpkg.com/wasm-feature-detect/dist/umd/index.js"></script>
<script>
if (await wasmFeatureDetect.simd()) {
// ...
}
if (await wasmFeatureDetect.simd()) {
// ...
}
</script>
```

## Detectors

All detectors return a `Promise<bool>`.

| Function | Proposal |
| --- | --- |
| `bigInt()` | [BigInt integration](https://github.com/WebAssembly/JS-BigInt-integration) |
| `bulkMemory()` | [Bulk memory operations](https://github.com/webassembly/bulk-memory-operations) |
| `exceptions()` | [Exception handling](https://github.com/WebAssembly/exception-handling) |
| `extendedConst()` | [Extented Const Expressesions](https://github.com/WebAssembly/extended-const) |
| `gc()` | [Garbage Collection](https://github.com/WebAssembly/gc) |
| `jspi()` | [JavaScript Promise Integration](https://github.com/WebAssembly/js-promise-integration) |
| `memory64()` | [Memory64](https://github.com/WebAssembly/memory64) |
| `multiValue()` | [Multi-value](https://github.com/WebAssembly/multi-value) |
| `mutableGlobals()` | [Importable/Exportable mutable globals]() |
| `referenceTypes()` | [Reference Types](https://github.com/WebAssembly/reference-types) |
| `relaxedSimd()` | [Relaxed SIMD](https://github.com/webassembly/relaxed-simd) |
| `saturatedFloatToInt()` | [Non-trapping float-to-int conversions](https://github.com/WebAssembly/nontrapping-float-to-int-conversions) |
| `signExtensions()` | [Sign-extension operators](https://github.com/WebAssembly/sign-extension-ops) |
| `simd()` | [Fixed-Width SIMD](https://github.com/webassembly/simd) |
| `streamingCompilation()` | [Streaming Compilation](https://webassembly.github.io/spec/web-api/index.html#streaming-modules) |
| `tailCall()` | [Tail call](https://github.com/webassembly/tail-call) |
| `threads()` | [Threads](https://github.com/webassembly/threads) |
| `typeReflection()` | [Type Reflection](https://github.com/WebAssembly/js-types) |

| Function | Proposal |
| ------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `bigInt()` | [BigInt integration](https://github.com/WebAssembly/JS-BigInt-integration) |
| `bulkMemory()` | [Bulk memory operations](https://github.com/webassembly/bulk-memory-operations) |
| `exceptions()` | [Exception handling](https://github.com/WebAssembly/exception-handling) |
| `extendedConst()` | [Extented Const Expressesions](https://github.com/WebAssembly/extended-const) |
| `gc()` | [Garbage Collection](https://github.com/WebAssembly/gc) |
| `jspi()` | [JavaScript Promise Integration](https://github.com/WebAssembly/js-promise-integration) |
| `memory64()` | [Memory64](https://github.com/WebAssembly/memory64) |
| `multiValue()` | [Multi-value](https://github.com/WebAssembly/multi-value) |
| `mutableGlobals()` | [Importable/Exportable mutable globals]() |
| `referenceTypes()` | [Reference Types](https://github.com/WebAssembly/reference-types) |
| `relaxedSimd()` | [Relaxed SIMD](https://github.com/webassembly/relaxed-simd) |
| `saturatedFloatToInt()` | [Non-trapping float-to-int conversions](https://github.com/WebAssembly/nontrapping-float-to-int-conversions) |
| `signExtensions()` | [Sign-extension operators](https://github.com/WebAssembly/sign-extension-ops) |
| `simd()` | [Fixed-Width SIMD](https://github.com/webassembly/simd) |
| `streamingCompilation()` | [Streaming Compilation](https://webassembly.github.io/spec/web-api/index.html#streaming-modules) |
| `tailCall()` | [Tail call](https://github.com/webassembly/tail-call) |
| `threads()` | [Threads](https://github.com/webassembly/threads) |
| `typeReflection()` | [Type Reflection](https://github.com/WebAssembly/js-types) |

## Why are all the tests async?

Expand Down

0 comments on commit 6e6fad5

Please sign in to comment.