zarrita
TypeScript icon, indicating that this package has built-in type declarations

0.5.1 • Public • Published

zarrita.js

NPM License GitHub Actions

a minimal & modular Zarr implementation in TypeScript

  • Zero dependencies (optionally scijs/ndarray)
  • Runs natively in Node, Browsers, and Deno (ESM)
  • Supports v2 or v3 protocols, C & F-order arrays, diverse data-types, and ZEP2 Sharding
  • Allows flexible storage backends and compression codecs
  • Provides rich, in-editor type information via template literal types

Installation

npm install zarrita

Read the documentation to learn more about other environments.

Usage

import * as zarr from "zarrita";

const store = new zarr.FetchStore("http://localhost:8080/data.zarr");
const arr = await zarr.open(store, { kind: "array" }); // zarr.Array<DataType, FetchStore>

// read chunk
const chunk = await arr.getChunk([0, 0]);

// Option 1: Builtin getter, no dependencies
const full = await zarr.get(arr); // { data: Int32Array, shape: number[], stride: number[] }

// Option 2: scijs/ndarray getter, includes `ndarray` and `ndarray-ops` dependencies
import { get } from "@zarrita/ndarray";
const full = await get(arr); // ndarray.Ndarray<Int32Array>

// read region
const region = await get(arr, [null, zarr.slice(6)]);

Read the documentation to learn more.

Readme

Keywords

none

Package Sidebar

Install

npm i zarrita

Weekly Downloads

9,156

Version

0.5.1

License

MIT

Unpacked Size

414 kB

Total Files

121

Last publish

Collaborators

  • manzt