Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed May 26, 2024
1 parent 3d33293 commit 6277e55
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Deno, and Bun.
[![JSR](https://jsr.io/badges/@cross/kv)](https://jsr.io/@cross/kv)
[![JSR Score](https://jsr.io/badges/@cross/kv/score)](https://jsr.io/@cross/kv)

Library usage:

```typescript
import { KV } from "@cross/kv";

Expand All @@ -32,6 +34,33 @@ console.log(await db.listAll(["users", { to: 10 }, "contact"]));
db.close();
```

Command line client `ckv`:

```bash
# Install
# deno install -frA --name ckv jsr:@cross/kv/cli

# Run without installing
deno run -A jsr:@cross/kv/cli

> open my.db
Success [10.30 ms]

> set:json my.key {"hello":"kv"}
Success [31.70 ms]

> get my.key

Key: ["my","key"]
Operation: SET (1)
Timestamp: 2024-05-26T19:49:49.471Z
Hash: abdf6eb7a3fe04af920f31a599ce0cc069d29041

{ hello: "kv" }

Success [7.74 ms]
```
## Features
- **Cross-Platform & Multi-Process:** Built with pure TypeScript for seamless
Expand All @@ -53,6 +82,8 @@ db.close();
## Installation
Library:
```bash
# Using npm
npx jsr add @cross/kv
Expand All @@ -64,6 +95,13 @@ deno add @cross/kv
bunx jsr add @cross/kv
```
Command line client `ckv`:
```bash
# Using Deno
deno install -frA --name ckv jsr:@cross/kv/cli
```
## API Documentation
### Methods
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cross/kv",
"version": "0.13.3",
"version": "0.14.0",
"exports": {
".": "./mod.ts",
"./cli": "./src/cli/mod.ts"
Expand Down
Binary file added my.db
Binary file not shown.
1 change: 0 additions & 1 deletion src/cli/commands/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
import { KVKeyInstance, type KVQuery } from "../../lib/key.ts";
import { KVOperation } from "../../lib/transaction.ts";
import { Colors } from "@cross/utils";
import { toHexString } from "../common.ts";

export async function scan(
container: KVDBContainer,
Expand Down

0 comments on commit 6277e55

Please sign in to comment.