@anodb/core 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +25 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -6,6 +6,12 @@
6
6
 
7
7
  <p align="center"><strong>A decentralized, local-first database.</strong><br />Zero servers to run. Zero servers to trust.</p>
8
8
 
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/@anodb/core"><img src="https://img.shields.io/npm/v/@anodb/core?label=%40anodb%2Fcore" alt="@anodb/core on npm" /></a>
11
+ <a href="https://www.npmjs.com/package/@anodb/cli"><img src="https://img.shields.io/npm/v/@anodb/cli?label=%40anodb%2Fcli" alt="@anodb/cli on npm" /></a>
12
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT license" /></a>
13
+ </p>
14
+
9
15
  anoDB is a decentralized, local-first database SDK that treats on-device SQLite as the source of truth and distributes changes as **end-to-end encrypted Nostr events** through existing public relays.
10
16
 
11
17
  True to its name, it requires **absolutely no developer-operated server**: no API server, no database server, and no project setup. Offline reads and writes, multi-device sync, sharing with other people, and reading/writing public Nostr data are available through a single type-safe, SQL-like API.
@@ -45,6 +51,8 @@ One interactive command does the whole setup:
45
51
  Then use it from any component:
46
52
 
47
53
  ```tsx
54
+ import { useAnoDB, useQuery } from '@anodb/core/react'
55
+
48
56
  const db = useAnoDB()
49
57
  const todos = useQuery((db) => db.selectFrom('todo').selectAll(), [])
50
58
  await db.insertInto('todo').values({ title: 'Milk', done: false }).execute()
@@ -53,11 +61,26 @@ await db.insertInto('todo').values({ title: 'Milk', done: false }).execute()
53
61
  No bundler configuration, no server, no account. Keys are generated on each user's device on first
54
62
  launch. Only one tab per origin opens the database; other tabs get `AnoDBError('tab-locked')`.
55
63
 
56
- Manual setup in a browser:
64
+ ### Packages
65
+
66
+ The product is **anoDB**; on npm it lives under the `@anodb` scope.
67
+
68
+ | Package | What it is |
69
+ |---|---|
70
+ | [`@anodb/core`](https://www.npmjs.com/package/@anodb/core) | The database: sync, sharing, keys, files, React hooks (`@anodb/core/react`) and Node driver (`@anodb/core/node`) |
71
+ | [`@anodb/cli`](https://www.npmjs.com/package/@anodb/cli) | `npx @anodb/cli init` — the setup wizard (you never import it) |
72
+ | [`nostr-p2p`](https://www.npmjs.com/package/nostr-p2p) | WebRTC over Nostr signaling, used internally by `@anodb/core` |
73
+
74
+ ### Manual setup
75
+
76
+ ```sh
77
+ npm install @anodb/core sql.js # sql.js only for browsers / Tauri
78
+ npx anodb assets # copy the SQLite WASM files to public/anodb/
79
+ ```
57
80
 
58
81
  ```ts
59
82
  import { browserDriver, createAnoDB } from '@anodb/core'
60
- const db = await createAnoDB({ appId, schema, driver: await browserDriver({ name: appId }) }) // sql.js from /anodb
83
+ const db = await createAnoDB({ appId, schema, driver: await browserDriver({ name: appId }) })
61
84
  ```
62
85
 
63
86
  Runs in browsers / Tauri (sql.js persisted to IndexedDB), Electron and Node.js 22.13+ (`node:sqlite`), and React Native / Expo (`expo-sqlite`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anodb/core",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Absolutely No DB — a decentralized, local-first database over Nostr. Zero servers to run. Zero servers to trust.",
5
5
  "type": "module",
6
6
  "license": "MIT",