Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@constl/orbit-db-kuiper
Advanced tools
Additional database types for orbit-db.
This package is deprecated in favour of the individual packages @orbitdb/feed-db, @orbitdb/set-db and @orbitdb/ordered-keyvalue-db.
$ pnpm add @constl/orbit-db-kuiper
Kuiper
brings additional database types to orbit-db
.
Feed
: For those feeling nostalgic for orbit-db v.0.x. But honestly, you're probably better off with a KeyValue
or a Set
.Set
: Like Feed
, but each value can only be present once. Works for primitive types as well as more complex objects.OrderedKeyValue
: A KeyValue
database where you can move entries around. Ideal for situations where order is important (e.g., lists of tabs in a spreadsheet, etc.).As simple example with Set
:
import { createOrbit } from "@orbitdb/core";
import { registerAll } from "@constl/orbit-db-kuiper";
// Register Kuiper database types. IMPORTANT - must call before creating orbit instance !
registerAll();
const orbit = await createOrbit({ ipfs })
const db = await orbit.open({ type: "set" });
await db.add(1);
await db.add(2);
const all = await db.all(); // [1, 2]
await db.add(1);
await db.all() // Yay !! Still [1, 2]
const db = await orbit.open({ type: "feed" });
await db.add({ a: 1, b: "c" });
const all = await db.all(); // [{ value: { a: 1, b: "c" }, hash: "..." }]
await db.add({ a: 1, b: "c" });
await db.all();
// [{ value: { a: 1, b: "c" }, hash: "..." }, { value: { a: 1, b: "c" }, hash: "..." }]
const db = await orbit.open({ type: "ordered-keyvalue" });
await db.put("a", "some value");
await db.put("b", "another value");
const all = await db.all();
// [{ key: "a", value: "some value", hash: "..." }, { key: "b", value: "another value", hash: "..." }]
await db.move("a", 1)
await db.all();
// [{ key: "b", value: "another value", hash: "..." }, { key: "a", value: "some value", hash: "..." }]
// You can also specify the position on `put`
await db.put("c", "goes first", 0);
await db.all();
// [{ key: "c", value: "goes first", hash: "..." }, { key: "b", value: "another value", hash: "..." }, { key: "a", value: "some value", hash: "..." }]
FAQs
Further database types for orbit-db.
The npm package @constl/orbit-db-kuiper receives a total of 1 weekly downloads. As such, @constl/orbit-db-kuiper popularity was classified as not popular.
We found that @constl/orbit-db-kuiper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.