Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/earthstar/src/entries/npm.ts>queryByGlob

Storage for private, distributed, offline-first applications.
Go to Latest
function queryByGlob
import { queryByGlob } from "https://deno.land/x/earthstar@v10.2.0/src/entries/npm.ts";

Find documents whose path matches the glob string. See documentation for globToQueryAndRegex for details on glob strings.

You can specify additional query options by providing a moreQueryOptions object. For example, you might want to set { contentLengthGt: 0 } to skip documents with empty content (e.g. "deleted" documents).

moreQueryOptions will override the glob's query, so it's best to avoid setting path, pathStartsWith or pathEndsWith in your moreQueryOptions unless you intend to override the glob's query.

Parameters

replica: Replica
glob: string
optional
moreQueryOptions: Omit<Query<[string]>, "formats"> = [UNSUPPORTED]
optional
formats: FormatsArg<F>