fitsjs-ng 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,7 +20,7 @@ Modern TypeScript library for reading and writing [FITS](https://fits.gsfc.nasa.
20
20
  - **Compressed Images** — Rice (RICE_1) decompression with subtractive dithering
21
21
  - **Multiple HDUs** — Sequential parsing of all Header Data Units
22
22
  - **Modern API** — Async/await, TypeScript types, ES modules, tree-shakeable
23
- - **Universal** — Works in Node.js (18+) and modern browsers
23
+ - **Universal** — Works in Node.js (18+), modern browsers, and React Native (runtime-safe root import)
24
24
 
25
25
  ## Installation
26
26
 
@@ -30,6 +30,20 @@ npm install fitsjs-ng
30
30
  pnpm add fitsjs-ng
31
31
  ```
32
32
 
33
+ ## Runtime Compatibility Matrix
34
+
35
+ | Capability | Node.js | Browser | React Native |
36
+ | -------------------------------------------------- | ------- | ---------------------------- | ---------------------------- |
37
+ | `import { ... } from 'fitsjs-ng'` root import | ✅ | ✅ | ✅ |
38
+ | FITS/SER/XISF from `ArrayBuffer`/`Blob`/`URL` | ✅ | ✅ | ✅ |
39
+ | XISF detached signature verification (default on) | ✅ | ✅ (requires WebCrypto) | ✅ (requires WebCrypto) |
40
+ | `NodeFSTarget` | ✅ | ❌ (runtime error) | ❌ (runtime error) |
41
+ | `HiPS.open('/local/path')` | ✅ | ❌ (runtime error) | ❌ (runtime error) |
42
+ | `lintHiPS('/local/path')` | ✅ | ❌ (runtime error report) | ❌ (runtime error report) |
43
+ | distributed XISF `path(...)` with default resolver | ✅ | ❌ (provide custom resolver) | ❌ (provide custom resolver) |
44
+
45
+ Node-only APIs fail with actionable runtime messages in non-Node environments instead of failing at bundle-import time.
46
+
33
47
  ## Quick Start
34
48
 
35
49
  ```ts
@@ -141,6 +155,23 @@ const lint = await lintHiPS('./out/my-hips')
141
155
  console.log(lint.ok, lint.issues)
142
156
  ```
143
157
 
158
+ ### React Native Notes
159
+
160
+ - Prefer `ArrayBuffer` / `Blob` / URL-based workflows.
161
+ - Use custom `HiPSExportTarget` implementations or browser-friendly targets (`BrowserZipTarget`) instead of `NodeFSTarget`.
162
+ - Avoid local filesystem path inputs (`HiPS.open('/path')`, `lintHiPS('/path')`) unless you provide your own storage abstraction.
163
+ - Detached XISF signature verification requires `crypto.subtle`; if unavailable, verification fails by default.
164
+
165
+ ```ts
166
+ import { XISF } from 'fitsjs-ng'
167
+
168
+ // If your RN runtime does not provide WebCrypto, disable signature verification explicitly.
169
+ const xisf = await XISF.fromArrayBuffer(bytes, {
170
+ verifySignatures: false,
171
+ signaturePolicy: 'ignore',
172
+ })
173
+ ```
174
+
144
175
  ## API Reference
145
176
 
146
177
  ### `FITS`