
Security News
TeamPCP and BreachForums Launch $1,000 Contest for Supply Chain Attacks
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.
@nostr-dev-kit/cache-sqlite
Advanced tools
SQLite cache adapter for NDK using better-sqlite3, compatible with Node.js environments.
SQLite cache adapter for NDK using better-sqlite3, compatible with Node.js environments.
npm install @nostr-dev-kit/cache-sqlite
# or
yarn add @nostr-dev-kit/cache-sqlite
# or
bun add @nostr-dev-kit/cache-sqlite
import NDK from '@nostr-dev-kit/ndk';
import { NDKCacheAdapterSqlite } from '@nostr-dev-kit/cache-sqlite';
const cache = new NDKCacheAdapterSqlite({
dbPath: './ndk-cache.db', // Optional: custom database path
dbName: 'ndk-cache' // Optional: database name (used if dbPath not provided)
});
const ndk = new NDK({
cacheAdapter: cache,
// ... other NDK options
});
// Initialize the cache adapter
await cache.initializeAsync(ndk);
await ndk.connect();
interface NDKCacheAdapterSqliteOptions {
dbPath?: string; // Custom path to SQLite database file
dbName?: string; // Database name (default: 'ndk-cache')
}
The adapter uses the same schema as cache-sqlite-wasm:
events - Stores Nostr eventsprofiles - Stores user profilesdecrypted_events - Stores decrypted eventsunpublished_events - Tracks unpublished eventsevent_tags - Indexes event tags for fast queriesrelay_status - Tracks relay connection statusnutzap_monitor_state - Stores nutzap monitoring stateThis package is designed to be a drop-in replacement for cache-sqlite-wasm in Node.js environments. The database schema is identical, allowing for easy migration between the two adapters.
# Install dependencies
bun install
# Run tests
bun test
# Build the package
bun run build
MIT
FAQs
SQLite cache adapter for NDK using better-sqlite3, compatible with Node.js environments.
We found that @nostr-dev-kit/cache-sqlite demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

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.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.

Research
GemStuffer abuses RubyGems as an exfiltration channel, packaging scraped UK council portal data into junk gems published from new accounts.