Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
petamoriken committed Mar 5, 2024
1 parent 9739f02 commit 758b001
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 71 deletions.
66 changes: 10 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,13 @@
</p>

<p align="center">
<a href="https://www.npmjs.com/package/@petamoriken/float16">
<img src="https://img.shields.io/npm/dw/@petamoriken/float16?logo=npm&amp;style=flat-square" alt="npm downloads">
</a>
<a href="https://www.jsdelivr.com/package/npm/@petamoriken/float16">
<img src="https://img.shields.io/jsdelivr/npm/hw/@petamoriken/float16?label=hits&amp;logo=jsDelivr&amp;style=flat-square" alt="jsDelivr hits">
</a>
<a href="https://www.npmjs.com/package/@petamoriken/float16">
<img src="https://img.shields.io/npm/v/@petamoriken/float16.svg?label=version&amp;logo=npm&amp;style=flat-square" alt="npm version">
</a>
<a href="https://deno.land/x/float16">
<img src="https://img.shields.io/github/v/tag/petamoriken/float16?label=version&amp;logo=deno&amp;style=flat-square" alt="deno version">
</a>
<a href="https://www.npmjs.com/package/@petamoriken/float16"><img src="https://img.shields.io/npm/dw/@petamoriken/float16?logo=npm&amp;style=flat-square" alt="npm downloads"></a>
<a href="https://www.npmjs.com/package/@petamoriken/float16"><img src="https://img.shields.io/npm/v/@petamoriken/float16.svg?label=version&amp;logo=npm&amp;style=flat-square" alt="npm version"></a>
<a href="https://jsr.io/@petamoriken/float16"><img src="https://jsr.io/badges/@petamoriken/float16?label=version&amp;style=flat-square" alt="jsr version"></a>
<br>
<a href="https://github.com/petamoriken/float16/blob/master/package.json">
<img src="https://img.shields.io/badge/dependencies-none-brightgreen?style=flat-square" alt="dependencies">
</a>
<a href="https://github.com/petamoriken/float16/blob/master/LICENSE">
<img src="https://img.shields.io/npm/l/@petamoriken/float16.svg?style=flat-square" alt="license">
</a>
<a href="https://codecov.io/gh/petamoriken/float16">
<img src="https://img.shields.io/codecov/c/gh/petamoriken/float16?logo=codecov&amp;style=flat-square" alt="codecov">
</a>
<a href="https://github.com/petamoriken/float16/blob/master/package.json"><img src="https://img.shields.io/badge/dependencies-none-brightgreen?style=flat-square" alt="dependencies"></a>
<a href="https://github.com/petamoriken/float16/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/@petamoriken/float16.svg?style=flat-square" alt="license"></a>
<a href="https://codecov.io/gh/petamoriken/float16"><img src="https://img.shields.io/codecov/c/gh/petamoriken/float16?logo=codecov&amp;style=flat-square" alt="codecov"></a>
</p>

<p align="center">
Expand All @@ -44,8 +29,10 @@
npm install @petamoriken/float16
```

### Deno

```console
yarn add @petamoriken/float16
deno add @petamoriken/float16
```

### Bun
Expand All @@ -56,39 +43,16 @@ bun add @petamoriken/float16

## Import

### Node.js, Bun or Bundler (webpack, rollup.js, esbuild, etc)
### Node.js, Deno, Bun or Bundler

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

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

### Deno

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

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

### Browser

Deliver a `browser/float16.mjs` or `browser/float16.js` file in the npm package
Expand Down Expand Up @@ -164,7 +128,6 @@ environments:
- Node.js: Active LTS
- Firefox: last 2 versions and ESR
- Chrome: last 2 versions
- Edge: last 2 versions
- Safari: last 2 versions

## API
Expand Down Expand Up @@ -346,21 +309,12 @@ f16round(1.337); // 1.3369140625
### Node.js
```js
// ES Modules
import { Float16Array } from "@petamoriken/float16";
import { customInspect } from "@petamoriken/float16/inspect";
Float16Array.prototype[Symbol.for("nodejs.util.inspect.custom")] = customInspect;
```
```js
// CommonJS
const { Float16Array } = require("@petamoriken/float16");
const { customInspect } = require("@petamoriken/float16/inspect");
Float16Array.prototype[Symbol.for("nodejs.util.inspect.custom")] = customInspect;
```
### Deno
```ts
Expand Down
14 changes: 0 additions & 14 deletions nightwatch.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,6 @@ module.exports = {
},
},

edge: {
desiredCapabilities: {
browserName: "MicrosoftEdge",
browserVersion: "latest",
},
},

edge_old: {
desiredCapabilities: {
browserName: "MicrosoftEdge",
browserVersion: "latest-1",
},
},

safari: {
desiredCapabilities: {
browserName: "safari",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"refresh": "yarn run clean && yarn run build && yarn run docs",
"setup-test-browser": "http-server docs/test -p 8000 > /dev/null 2>&1 &",
"test": "mocha test/*.js",
"test-browser": "nightwatch -e chrome,chrome_old,firefox,firefox_old,firefox_esr,edge,edge_old,safari",
"test-browser": "nightwatch -e chrome,chrome_old,firefox,firefox_old,firefox_esr,safari,safari_old",
"version": "NPM_VERSION_SCRIPT=1 yarn run refresh"
},
"devDependencies": {
Expand Down

0 comments on commit 758b001

Please sign in to comment.