| name | fastify-orama |
| description | Knowledge pack for fastify-orama — a Fastify plugin that integrates Orama full-text search with persistence support. |
| metadata | {"author":"mateonunez","version":"4.0.0","source":"https://github.com/mateonunez/fastify-orama","stack":"Fastify 5, Orama 3, fastify-plugin, JavaScript + TypeScript declarations"} |
fastify-orama
Fastify plugin for Orama search engine. Provides a proxy API over all Orama functions via fastify.orama, with optional data persistence (in-memory or file-based) and TypeScript generics via withOrama<T>().
Preferences
- Language: JavaScript (CommonJS) with TypeScript declaration files
- Linter: StandardJS (not Biome/ESLint)
- Testing:
borp (TAP protocol) + c8 coverage + tstyche for type tests
- Plugin pattern:
fastify-plugin wrapper with { fastify: '5.x', name: 'fastify-orama' }
- Compatibility: Plugin v4 → Fastify 5 + Orama 3
References
Quick Reference
npm test
npm run unit
npm run typescript
npm run lint
const fastify = require('fastify')();
const { fastifyOrama } = require('fastify-orama');
await fastify.register(fastifyOrama, {
schema: { title: 'string', body: 'string', tag: 'enum' },
});
await fastify.orama.insert({ title: 'Hello', body: 'World', tag: 'news' });
const results = await fastify.orama.search({ term: 'hello' });
const app = fastify().withOrama<{ title: 'string'; body: 'string' }>();