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
a month ago (0.5.1)
class Array
extends Location<Store>

Constructors

new
Array(
store: Store,
path: AbsolutePath,
metadata: ArrayMetadata<Dtype>,
)

Type Parameters

Dtype extends DataType
Store extends Readable = Readable

Properties

readonly
chunks: number[]
readonly
dtype: Dtype
readonly
kind: string
readonly
shape: number[]

Methods

getChunk(
chunk_coords: number[],
options?: Parameters<Store["get"]>[1],
): Promise<Chunk<Dtype>>
is<Query extends DataTypeQuery>(query: Query): this is Array<NarrowDataType<Dtype, Query>, Store>

A helper method to narrow zarr.Array Dtype.

let arr: zarr.Array<DataType, FetchStore> = zarr.open(store, { kind: "array" });

// Option 1: narrow by scalar type (e.g. "bool", "raw", "bigint", "number")
if (arr.is("bigint")) {
  // zarr.Array<"int64" | "uint64", FetchStore>
}

// Option 3: exact match
if (arr.is("float32")) {
  // zarr.Array<"float32", FetchStore, "/">
}

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 { Array } from "@zarrita/zarrita";
or

Import directly with a jsr specifier

import { Array } 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 { Array } 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 { Array } from "@zarrita/zarrita";

Add Package

npx jsr add @zarrita/zarrita

Import symbol

import { Array } from "@zarrita/zarrita";

Add Package

bunx jsr add @zarrita/zarrita

Import symbol

import { Array } from "@zarrita/zarrita";