Skip to main content
Home

Built and signed on GitHub Actions

A JavaScript toolkit for working with chunked, compressed, n-dimensional arrays

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
94%
Published
3 months ago (0.5.1)

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.

Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@zarrita/zarrita

Import symbol

import * as zarrita from "@zarrita/zarrita";
or

Import directly with a jsr specifier

import * as zarrita from "jsr:@zarrita/zarrita";

Add Package

pnpm i jsr:@zarrita/zarrita
or (using pnpm 10.8 or older)
pnpm dlx jsr add @zarrita/zarrita

Import symbol

import * as zarrita from "@zarrita/zarrita";

Add Package

yarn add jsr:@zarrita/zarrita
or (using Yarn 4.8 or older)
yarn dlx jsr add @zarrita/zarrita

Import symbol

import * as zarrita from "@zarrita/zarrita";

Add Package

vlt install jsr:@zarrita/zarrita

Import symbol

import * as zarrita from "@zarrita/zarrita";

Add Package

npx jsr add @zarrita/zarrita

Import symbol

import * as zarrita from "@zarrita/zarrita";

Add Package

bunx jsr add @zarrita/zarrita

Import symbol

import * as zarrita from "@zarrita/zarrita";