Skip to content

Commit 90a8038

Browse files
authored
Documented support for Bun and CI tests on Bun (#161)
2 parents 262ef23 + 1e1290a commit 90a8038

4 files changed

Lines changed: 36 additions & 23 deletions

File tree

.github/workflows/ci.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
run: tar -xzf cldn-ip-0.0.0-dev.tgz --strip-components=1 -C . --overwrite
7777

7878
- name: Test
79-
run: npm run test
79+
run: npm run test:coverage
8080

8181
test-deno:
8282
name: Test on Deno
@@ -98,13 +98,32 @@ jobs:
9898
run: deno fmt --check
9999

100100
- name: Test
101-
run: deno task test
101+
run: deno task test:coverage
102+
103+
test-bun:
104+
name: Test on Bun
105+
runs-on: ubuntu-latest
106+
needs: build
107+
108+
steps:
109+
- name: Checkout repository
110+
uses: actions/checkout@v6
111+
112+
- name: Setup Bun
113+
uses: oven-sh/setup-bun@v2
114+
115+
- name: Install dependencies
116+
run: bun install
117+
118+
- name: Run tests
119+
run: bun run test
102120

103121
publish:
104122
name: Publish
105123
needs:
106124
- test
107125
- test-deno
126+
- test-bun
108127
if: github.event_name == 'release'
109128
runs-on: ubuntu-latest
110129
permissions:
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,22 @@ arithmetic on IP addresses and subnets.
1515

1616
## Usage
1717

18-
### Node.js
18+
### Installation
1919

20-
Install from NPM:
20+
Install the package using your preferred environment:
2121

2222
```sh
23+
# Node.js
2324
npm install @cldn/ip
24-
```
25-
26-
Import and use:
27-
28-
```ts
29-
import { IPv4, IPv6, Subnet } from "@cldn/ip";
30-
```
31-
32-
### Deno
33-
34-
Add from JSR:
3525

36-
```sh
26+
# Deno
3727
deno add jsr:@cldn/ip
28+
29+
# Bun
30+
bun install @cldn/ip
3831
```
3932

40-
Import and use:
33+
### Import
4134

4235
```ts
4336
import { IPv4, IPv6, Subnet } from "@cldn/ip";
@@ -46,10 +39,10 @@ import { IPv4, IPv6, Subnet } from "@cldn/ip";
4639
### Browsers
4740

4841
For browser usage, it is recommended to use a bundler like
49-
[Vite](https://vitejs.dev/), or [Webpack](https://webpack.js.org/). If you are
50-
using a bundler, follow the same usage as for Node.js.
42+
[Vite](https://vitejs.dev/) or [Webpack](https://webpack.js.org/). If using a
43+
bundler, import as above.
5144

52-
Alternatively, you can import the library as a
45+
Alternatively, load as a
5346
[JavaScript module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)
5447
from [ESM>CDN](https://esm.sh/):
5548

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
],
1414
"scripts": {
1515
"build": "tsc",
16-
"test": "vitest run --coverage",
16+
"test": "vitest run",
17+
"test:coverage": "vitest run --coverage",
1718
"docs:gen": "typedoc && rm -rf docs/api && mv api docs/api",
1819
"predocs:dev": "npm run docs:gen",
1920
"docs:dev": "vitepress dev docs",

0 commit comments

Comments
 (0)