@walkthru-earth/objex-utils 1.0.0 → 1.2.0

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 ADDED
@@ -0,0 +1,99 @@
1
+ # @walkthru-earth/objex-utils
2
+
3
+ [![npm](https://img.shields.io/npm/v/@walkthru-earth/objex-utils?color=cb3837)](https://www.npmjs.com/package/@walkthru-earth/objex-utils)
4
+ [![License: CC BY 4.0](https://img.shields.io/badge/license-CC%20BY%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/)
5
+
6
+ Pure TypeScript utilities extracted from [objex](https://github.com/walkthru-earth/objex). Zero Svelte dependency. Works with any JS framework or Node 18+.
7
+
8
+ Built for high-performance geospatial pipelines: WKB parsing, GeoArrow table construction, GeoParquet footer reading via range requests, cloud URL parsing, and a 200+ extension file-type registry.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ pnpm add @walkthru-earth/objex-utils
14
+ # or
15
+ npm install @walkthru-earth/objex-utils
16
+ ```
17
+
18
+ ## At a glance
19
+
20
+ ```ts
21
+ import {
22
+ // WKB / GeoArrow
23
+ parseWKB,
24
+ findGeoColumn,
25
+ buildGeoArrowTables,
26
+
27
+ // Parquet metadata (hyparquet, range requests)
28
+ readParquetMetadata,
29
+ extractEpsgFromGeoMeta,
30
+ extractBounds,
31
+
32
+ // Storage URLs
33
+ parseStorageUrl,
34
+ resolveCloudUrl,
35
+ looksLikeUrl,
36
+
37
+ // File-type registry
38
+ getFileTypeInfo,
39
+ getViewerKind,
40
+ getDuckDbReadFn,
41
+ isQueryable,
42
+
43
+ // Formatting / classification / hex / CSV / JSON
44
+ formatFileSize,
45
+ formatValue,
46
+ classifyType,
47
+ generateHexDump,
48
+ serializeToCsv,
49
+ serializeToJson,
50
+
51
+ // Error handling
52
+ handleLoadError,
53
+
54
+ // Constants
55
+ WGS84_CODES,
56
+ DEFAULT_TARGET_CRS,
57
+ STORAGE_KEYS,
58
+ } from '@walkthru-earth/objex-utils';
59
+ ```
60
+
61
+ ## Documentation
62
+
63
+ Full per-module developer reference lives in [`docs/`](./docs/README.md). Each page lists the exact TypeScript signature, parameter semantics, return shape, peer-dependency requirements, and non-obvious behavior.
64
+
65
+ | Page | Covers |
66
+ |------|--------|
67
+ | [`docs/geometry.md`](./docs/geometry.md) | WKB parser, GeoArrow builder, geometry-column detection |
68
+ | [`docs/cog.md`](./docs/cog.md) | Cloud-Optimized GeoTIFF pipeline helpers, band configs, color ramps |
69
+ | [`docs/parquet-metadata.md`](./docs/parquet-metadata.md) | `readParquetMetadata` + CRS / bounds / geometry-type extractors |
70
+ | [`docs/storage.md`](./docs/storage.md) | URL parsing, provider registry, `StorageAdapter`, `UrlAdapter` |
71
+ | [`docs/query-engine.md`](./docs/query-engine.md) | `QueryEngine` interface + handle / result types |
72
+ | [`docs/file-types.md`](./docs/file-types.md) | File-type registry: `getFileTypeInfo`, `getViewerKind`, `getDuckDbReadFn`, … |
73
+ | [`docs/formatting.md`](./docs/formatting.md) | Display formatters, column-type classification, hex dump, CSV/JSON export |
74
+ | [`docs/file-sort.md`](./docs/file-sort.md) | `sortFileEntries`, `toggleSortField` |
75
+ | [`docs/markdown-sql.md`](./docs/markdown-sql.md) | Markdown + SQL block parsing (Evidence-compatible) |
76
+ | [`docs/local-storage.md`](./docs/local-storage.md) | SSR-safe `loadFromStorage` / `persistToStorage` |
77
+ | [`docs/errors.md`](./docs/errors.md) | `handleLoadError` |
78
+ | [`docs/types-constants.md`](./docs/types-constants.md) | `Connection`, `Tab`, `FileEntry`, `WriteResult`, `Theme`, shared constants |
79
+
80
+ ## Optional peer dependencies
81
+
82
+ Heavy dependencies are **optional** peers. Install only what you use.
83
+
84
+ | Peer | Required by |
85
+ |------|-------------|
86
+ | `apache-arrow >=14` | `buildGeoArrowTables` |
87
+ | `hyparquet >=1.25` | `readParquetMetadata` and friends |
88
+ | `hyparquet-compressors >=1.1` | SNAPPY / ZSTD / GZIP / LZ4 / BROTLI support in `readParquetMetadata` |
89
+ | `yaml >=2` | `parseMarkdownDocument` (lazy-loaded — only when frontmatter is present) |
90
+
91
+ As of v1.2 the `yaml` dependency is imported dynamically inside `parseMarkdownDocument`. Consumers who never call that function do not need `yaml` at all. Before v1.2 the bundle failed to load without `yaml` even for unrelated imports.
92
+
93
+ ## Related
94
+
95
+ - [`@walkthru-earth/objex`](https://www.npmjs.com/package/@walkthru-earth/objex) — Full Svelte 5 component library with viewers, stores, and query engine.
96
+
97
+ ## License
98
+
99
+ [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)