zarrita
v0.5.1
Published
[](https://www.npmjs.com/package/zarrita) [](https://github.com/manzt/zarrita.js/raw/main/LICENSE)  - 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.