@walkthru-earth/objex-utils
v1.5.0
Published
Pure TypeScript utilities from objex — WKB parser, GeoArrow builder, storage URL parser, file type registry
Readme
@walkthru-earth/objex-utils
Pure TypeScript utilities extracted from objex. Zero Svelte dependency. Works with any JS framework or Node 18+.
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.
Install
pnpm add @walkthru-earth/objex-utils
# or
npm install @walkthru-earth/objex-utilsAt a glance
import {
// WKB / GeoArrow
parseWKB,
findGeoColumn,
buildGeoArrowTables,
// Parquet metadata (hyparquet, range requests)
readParquetMetadata,
extractEpsgFromGeoMeta,
extractBounds,
// stac-geoparquet (detection + row → STAC Item)
isStacGeoparquetSchema,
stacRowToItem,
flattenStacBbox,
pickStacPrimaryAsset,
resolveStacAssetHref,
// Storage URLs
parseStorageUrl,
resolveCloudUrl,
looksLikeUrl,
// File-type registry
getFileTypeInfo,
getViewerKind,
getDuckDbReadFn,
isQueryable,
// Formatting / classification / hex / CSV / JSON
formatFileSize,
formatValue,
classifyType,
generateHexDump,
serializeToCsv,
serializeToJson,
// Error handling
handleLoadError,
// Constants
WGS84_CODES,
DEFAULT_TARGET_CRS,
STORAGE_KEYS,
} from '@walkthru-earth/objex-utils';Usage
The package ships ESM and CommonJS builds with full TypeScript types, so it behaves the same across toolchains. Every export is a plain function, class, or constant with no framework coupling, there is no provider, context, or adapter to wire up.
ESM (browser bundlers, modern Node, TypeScript):
import { parseStorageUrl, formatFileSize } from '@walkthru-earth/objex-utils';
const parsed = parseStorageUrl('s3://my-bucket/data/');
const label = formatFileSize(1048576); // human-readable sizeCommonJS (Node require):
const { parseStorageUrl, formatFileSize } = require('@walkthru-earth/objex-utils');Framework notes:
- React, Vue, Svelte, Solid, or vanilla JS, import the functions and call them directly. The package holds no framework state and renders no UI, so no wrapper is needed.
- Node 18+, the data utilities (
readParquetMetadata,parseStorageUrl, WKB and GeoArrow builders) run server-side on the globalfetch. Browser-only helpers such ascopyToClipboardandloadFromStoragedetect the missing API and no-op or return defaults rather than throwing. - Install only the optional peers for the functions you actually call (see the table below).
Documentation
Full per-module developer reference lives in docs/, the authoritative index. Each page lists the exact TypeScript signature, parameter semantics, return shape, peer-dependency requirements, and non-obvious behavior. The areas below link a few entry points, see the docs index for all 24 modules.
| Area | Pages |
|------|-------|
| Geometry and raster | geometry, parquet-metadata, cog (pure helpers only, the render pipeline stays in @walkthru-earth/objex), cog-asset, channel-composite |
| STAC | stac, stac-geoparquet, stac-facets, stac-pushdown, stac-source, stac-hydrate, stac-storage-extension |
| Storage and URLs | storage |
| Files and formatting | file-types, formatting (formatters, column types, hex dump, CSV/JSON), file-sort |
| App utilities | app-config, types-constants, local-storage, markdown-sql, lru, map-pixel-inspect, errors, query-engine |
Optional peer dependencies
Heavy dependencies are optional peers. Install only what you use.
| Peer | Required by |
|------|-------------|
| apache-arrow >=14 | buildGeoArrowTables |
| hyparquet >=1.25 | readParquetMetadata and friends |
| hyparquet-compressors >=1.1 | SNAPPY / ZSTD / GZIP / LZ4 / BROTLI support in readParquetMetadata |
| yaml >=2 | parseMarkdownDocument (lazy-loaded, only when frontmatter is present) |
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.
Related
@walkthru-earth/objex, the full Svelte 5 component library with viewers, stores, and query engine.
