{"id":18908806,"url":"https://github.com/orbitdb/ordered-keyvalue-db","last_synced_at":"2026-03-06T19:30:19.365Z","repository":{"id":218282325,"uuid":"746040240","full_name":"orbitdb/ordered-keyvalue-db","owner":"orbitdb","description":"Ordered keyvalue database type for orbit-db","archived":false,"fork":false,"pushed_at":"2024-10-30T05:31:01.000Z","size":530,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-12-31T12:26:19.677Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orbitdb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-20T22:10:01.000Z","updated_at":"2024-10-30T05:31:04.000Z","dependencies_parsed_at":"2024-01-25T21:31:18.503Z","dependency_job_id":"dedfbe9f-2852-4865-95de-5e7fb2664074","html_url":"https://github.com/orbitdb/ordered-keyvalue-db","commit_stats":null,"previous_names":["orbitdb/ordered-keyvalue-db"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb%2Fordered-keyvalue-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb%2Fordered-keyvalue-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb%2Fordered-keyvalue-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbitdb%2Fordered-keyvalue-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orbitdb","download_url":"https://codeload.github.com/orbitdb/ordered-keyvalue-db/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239896115,"owners_count":19714961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T09:28:40.410Z","updated_at":"2026-03-06T19:30:19.310Z","avatar_url":"https://github.com/orbitdb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @orbitdb/ordered-keyvalue-db\nOrdered keyvalue database type for OrbitDB.\n\n[![Tests](https://github.com/orbitdb/ordered-keyvalue-db/actions/workflows/run-test.yml/badge.svg?branch=main)](https://github.com/orbitdb/ordered-keyvalue-db/actions/workflows/tests.yml)\n[![codecov](https://codecov.io/gh/orbitdb/ordered-keyvalue-db/graph/badge.svg?token=7OZK4BJDej)](https://codecov.io/gh/orbitdb/ordered-keyvalue-db)\n\n## Installation\n```\n$ pnpm add @orbitdb/ordered-keyvalue-db\n```\n## Introduction\nA `KeyValue` database where you can move entries around. Ideal for situations where order is important (e.g., lists of tabs in a spreadsheet, etc.). \n\n## Examples\n\n```ts\nimport { createOrbitDB } from \"@orbitdb/core\";\nimport { registerOrderedKeyValue } from \"@orbitdb/ordered-keyvalue-db\";\n\n// Register database type. IMPORTANT - must call before creating orbit instance !\nregisterOrderedKeyValue();\n\nconst orbit = await createOrbitDB({ ipfs })\n\nconst db = await orbit.open({ type: \"ordered-keyvalue\" });\n\nawait db.put(\"a\", \"some value\");\nawait db.put(\"b\", \"another value\");\n\nconst all = await db.all();\n// [{ key: \"a\", value: \"some value\", hash: \"...\" }, { key: \"b\", value: \"another value\", hash: \"...\" }]\n\nawait db.move(\"a\", 1)\n\nawait db.all();\n// [{ key: \"b\", value: \"another value\", hash: \"...\" }, { key: \"a\", value: \"some value\", hash: \"...\" }]\n\n// You can also specify the position on `put`\nawait db.put(\"c\", \"goes first\", 0);\n\nawait db.all();\n// [{ key: \"c\", value: \"goes first\", hash: \"...\" }, { key: \"b\", value: \"another value\", hash: \"...\" }, { key: \"a\", value: \"some value\", hash: \"...\" }]\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitdb%2Fordered-keyvalue-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forbitdb%2Fordered-keyvalue-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbitdb%2Fordered-keyvalue-db/lists"}