Skip to content

Commit ddc172f

Browse files
committed
README
1 parent af60497 commit ddc172f

File tree

4 files changed

+27
-50
lines changed

4 files changed

+27
-50
lines changed

.github/workflows/jsr.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Publish
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Publish package
19+
run: npx jsr publish

.github/workflows/publish.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66
!LICENSE
77
!examples
88
!src
9-
src/*
10-
!**/*.ts
11-
!**/*.mjs
9+
src/**/*.*
10+
!src/**/*.ts

README.md

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Fetch and parse XML documents using the power of JavaScript web streams and async iterators ✨
44

5+
[![JSR](https://jsr.io/badges/@dbushell/xml-streamify?labelColor=98e6c8)](https://jsr.io/@dbushell/xml-streamify) [![JSR Score](https://jsr.io/badges/@dbushell/xml-streamify/score?labelColor=98e6c8)](https://jsr.io/@dbushell/xml-streamify) [![JSR](https://jsr.io/badges/@dbushell?labelColor=98e6c8)](https://jsr.io/@dbushell)
6+
57
* Small, fast, zero dependencies †
68
* Work with data before the fetch is complete
79
* Cross-runtime support (Bun ‡, Deno, Node, and web browsers)
@@ -10,15 +12,11 @@ Fetch and parse XML documents using the power of JavaScript web streams and asyn
1012

1113
## Usage
1214

13-
Add dependency from JSR: [@dbushell/xml-streamify](https://jsr.io/@dbushell/xml-streamify). See the `examples` directory for platform specific examples.
14-
15-
```javascript
16-
import {parse} from "jsr:@dbushell/xml-streamify";
17-
```
18-
1915
The `parse` generator function is the main export. Below is a basic example that logs RSS item titles as they're found:
2016

2117
```javascript
18+
import {parse} from "@dbushell/xml-streamify";
19+
2220
for await (const node of parse('https://dbushell.com/rss.xml')) {
2321
if (node.is('channel', 'item')) {
2422
console.log(node.first('title').innerText);
@@ -39,10 +37,10 @@ for await (const [type, value] of stream) {
3937
}
4038
```
4139

42-
See [`examples/advanced/stream.ts`](/examples/advanced/stream.ts) for a full example.
43-
4440
## Advanced
4541

42+
See the `examples` directory for more advanced and platform specific examples.
43+
4644
In the `examples/advanced` directory there is a Deno web server. It will proxy RSS feeds, add CORS headers, and throttle streaming speed for testing. Run `deno run -A examples/advanced/mod.ts` for the full example script.
4745

4846
## Notes
@@ -55,20 +53,6 @@ Browsers may need a [polyfill](https://bugs.chromium.org/p/chromium/issues/detai
5553

5654
‡ Bun has issues ([#2489](https://github.com/oven-sh/bun/issues/2489))
5755

58-
## NPM
59-
60-
Add the [JavaScript Registry](https://jsr.io/) to `.npmrc`:
61-
62-
```
63-
@jsr:registry=https://npm.jsr.io
64-
```
65-
66-
Install the package:
67-
68-
```sh
69-
npm install @jsr/dbushell__xml-streamify
70-
```
71-
7256
* * *
7357

7458
[MIT License](/LICENSE) | Copyright © 2024 [David Bushell](https://dbushell.com)

0 commit comments

Comments
 (0)