@nebula-db/plugin-cache
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

@nebula-db/plugin-cache

Query caching plugin for NebulaDB

Part of the NebulaDB project - a high-performance, reactive, TypeScript-first, schema-optional, embeddable NoSQL database.

Installation

npm install @nebula-db/plugin-cache

Usage

import { createDb } from '@nebula-db/core';
import { MemoryAdapter } from '@nebula-db/adapter-memory';
import { createCachePlugin } from '@nebula-db/plugin-cache';

// Create the plugin
const cachePlugin = createCachePlugin();

// Create a database with the plugin
const db = createDb({
  adapter: new MemoryAdapter(),
  plugins: [cachePlugin]
});

// Use the database with the plugin
const users = db.collection('users');
await users.insert({ name: 'Alice', age: 30 });

Documentation

For full documentation, visit the NebulaDB GitHub repository.

License

MIT

Package Sidebar

Install

npm i @nebula-db/plugin-cache

Weekly Downloads

25

Version

0.2.2

License

MIT

Unpacked Size

1.82 kB

Total Files

2

Last publish

Collaborators

  • codeteck