New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nostr-dev-kit/ndk-cache-nostr

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nostr-dev-kit/ndk-cache-nostr

NDK cache adapter that uses a local nostr relay.

  • 0.1.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
108
increased by2600%
Maintainers
0
Weekly downloads
 
Created
Source

ndk-cache-nostr

NDK cache adapter using a nostr relay as the database.

This cache adapter is meant to be run against a local relay. This adapter will generate two NDK instances:

ndk -- This talks exclusively to the local relay, with outbox model disabled. fallbackNdk -- This is used to hydrate the cache and uses the outbox model -- each query the cache receives is placed in a queue in the background so that subsequent requests can be served from the cache. All events from other relays

Usage

Install

npm add @nostr-dev-kit/ndk-cache-nostr

Add as a cache adapter

import NDKCacheAdapterNostr from "@nostr-dev-kit/ndk-cache-nostr";

const cacheAdapter = new NDKCacheAdapterNostr({
    relayUrl: "ws://localhost:5577",
});
const ndk = new NDK({ cacheAdapter });

If running server-side in a NodeJS environment, you should make sure to polyfill WebSocket.

License

MIT

Keywords

FAQs

Package last updated on 13 Feb 2025

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc