Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
petamoriken committed Oct 9, 2021
1 parent 3fa12ca commit 2e24437
Showing 1 changed file with 40 additions and 8 deletions.
48 changes: 40 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,32 @@ yarn add @petamoriken/float16

```js
// ES Modules
import { Float16Array, isFloat16Array, getFloat16, setFloat16, hfround } from "@petamoriken/float16";
import {
Float16Array, isFloat16Array,
getFloat16, setFloat16,
hfround,
} from "@petamoriken/float16";
```

```js
// CommonJS
const { Float16Array, isFloat16Array, getFloat16, setFloat16, hfround } = require("@petamoriken/float16");
const {
Float16Array, isFloat16Array,
getFloat16, setFloat16,
hfround,
} = require("@petamoriken/float16");
```

### Deno

You can get modules from [deno.land/x](https://deno.land/x/float16) hosting service.

```ts
import { Float16Array, isFloat16Array, getFloat16, setFloat16, hfround } from "https://deno.land/x/float16/mod.ts";
import {
Float16Array, isFloat16Array,
getFloat16, setFloat16,
hfround,
} from "https://deno.land/x/float16/mod.ts";
```

### Browser
Expand All @@ -71,15 +83,23 @@ Deliver a `browser/float16.mjs` or `browser/float16.js` file in the npm package
```html
<!-- Module Scripts -->
<script type="module">
import { Float16Array, isFloat16Array, getFloat16, setFloat16, hfround } from "DEST/TO/float16.mjs";
import {
Float16Array, isFloat16Array,
getFloat16, setFloat16,
hfround,
} from "DEST/TO/float16.mjs";
</script>
```

```html
<!-- Classic Scripts -->
<script src="DEST/TO/float16.js"></script>
<script>
const { Float16Array, isFloat16Array, getFloat16, setFloat16, hfround } = float16;
const {
Float16Array, isFloat16Array,
getFloat16, setFloat16,
hfround,
} = float16;
</script>
```

Expand All @@ -88,15 +108,23 @@ Or use [jsDelivr](https://cdn.jsdelivr.net/npm/@petamoriken/float16/) CDN.
```html
<!-- Module Scripts -->
<script type="module">
import { Float16Array, isFloat16Array, getFloat16, setFloat16, hfround } from "https://cdn.jsdelivr.net/npm/@petamoriken/float16/+esm";
import {
Float16Array, isFloat16Array,
getFloat16, setFloat16,
hfround,
} from "https://cdn.jsdelivr.net/npm/@petamoriken/float16/+esm";
</script>
```

```html
<!-- Classic Scripts -->
<script src="https://cdn.jsdelivr.net/npm/@petamoriken/float16/browser/float16.min.js"></script>
<script>
const { Float16Array, isFloat16Array, getFloat16, setFloat16, hfround } = float16;
const {
Float16Array, isFloat16Array,
getFloat16, setFloat16,
hfround,
} = float16;
</script>
```

Expand All @@ -105,7 +133,11 @@ ES modules are also available on the [Skypack](https://www.skypack.dev/view/@pet
```html
<!-- Module Scripts -->
<script type="module">
import { Float16Array, isFloat16Array, getFloat16, setFloat16, hfround } from "https://cdn.skypack.dev/@petamoriken/float16?min";
import {
Float16Array, isFloat16Array,
getFloat16, setFloat16,
hfround,
} from "https://cdn.skypack.dev/@petamoriken/float16?min";
</script>
```

Expand Down

0 comments on commit 2e24437

Please sign in to comment.