OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-kb / skills / corestore / api-extract.json

74 lines · json ref:
{
  "repo": "corestore",
  "timestamp": "2026-01-16T23:05:18.634Z",
  "entryPoint": "index.js",
  "exports": {
    "packageJson": {
      "main": "index.js"
    }
  },
  "api": {
    "file": "index.js",
    "exports": [
      {
        "type": "default",
        "name": "Corestore"
      }
    ],
    "classes": [
      {
        "name": "StreamTracker"
      },
      {
        "name": "SessionTracker"
      },
      {
        "name": "CoreTracker"
      },
      {
        "name": "FindingPeers"
      },
      {
        "name": "Corestore"
      }
    ],
    "functions": [
      {
        "name": "isStream"
      },
      {
        "name": "generateNamespace"
      },
      {
        "name": "deriveSeed"
      },
      {
        "name": "createKeyPair"
      },
      {
        "name": "noop"
      },
      {
        "name": "toHex"
      }
    ]
  },
  "readme": {
    "content": "# Corestore\n\n### [See the full API docs at docs.pears.com](https://docs.pears.com/helpers/corestore)\n\nCorestore is a Hypercore factory that makes it easier to manage large collections of named Hypercores.\n\nCorestore provides:\n\n1. **Key Derivation** - All writable Hypercore keys are derived from a single master key and a user-provided name.\n2. **Session Handling** - If a single Hypercore is loaded multiple times through the `get` method, the underlying resources will only be opened once (using Hypercore 10's new session feature). Once all sessions are closed, the resources will be released.\n3. **Storage Management** - Hypercores can be stored in any `hypercore-storage` instance, where they will be keyed by their discovery keys.\n4. **Namespacing** - You can share a single Corestore instance between multiple applications or components without worrying about naming collisions by creating \"namespaces\" (e.g. `corestore.namespace('my-app').get({ name: 'main' })`)\n\n### Installation\n\n`npm insta",
    "sections": [
      "intro"
    ],
    "hasApi": false,
    "hasExamples": true,
    "exampleCount": 5,
    "examples": [
      "const Corestore = require('corestore')\n\nconst store = new Corestore('./my-storage')\nconst core1 = store.get({ name: 'core-1' })\nconst core2 = store.get({ name: 'core-2' })",
      "{\n  primaryKey: null, // The primary key to use as the master key for key derivation.\n  writable: true,\n}",
      "const swarm = new Hyperswarm()\n\n// join the relevant topic\nswarm.join(...)\n\n// simply pass the connection stream to corestore\nswarm.on('connection', (connection) => store.replicate(connection))"
    ]
  },
  "patterns": [
    "append-only-log",
    "cryptography"
  ]
}