It's a little clunky to use ops methods because they require a separate import. For those concerned with bundle size, this is fine, but it might be unintuitive to a new user. As an alternative, we could export the builtin ops and add a namespace for ndarray:
Current
import * as zarr from "zarrita/v2";
import { get, set } from "zarrita/ops";
import * as ndops from "zarrita/ndarray";
import FetchStore from "zarrita/storage/fetch";
let root = await zarr.get(new FetchStore("http://localhost:8080/data.zarr");
let res = get(root);
set(root, ...);
ndops.get(root);
ndopts.set(root, ...);
Proposed
import * as zarr from "zarrita/v2";
import FetchStore from "zarrita/storage/fetch";
let root = await zarr.get_node(new FetchStore("http://localhost:8080/data.zarr")); // or `zarr.open` ?
let res = zarr.get(root);
zarr.set(root, ...);
zarr.ndarray.get(root);
zarr.ndarray.set(root, ...);
The primary issue I see is that by default import * as zarr
imports both ops and would likely increase bundle size on average. However, for those concerned with bundle size, named imports will remain treeshakeable.
import { get_node, get } from "zarrita/v2";
import FetchStore from "zarrita/storage/fetch";
let root = await get_node(new FetchStore("http://localhost:8080/data.zarr"));
let res = get(root);