Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@goatlab/fluent-loki

Package Overview
Dependencies
Maintainers
3
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@goatlab/fluent-loki

Readable query Interface & API generator for TS and Node

latest
npmnpm
Version
0.9.16
Version published
Maintainers
3
Created
Source

@goatlab/fluent-loki

LokiJS connector for Goat Fluent - a fast, in-memory database adapter with optional persistence.

Installation

npm install @goatlab/fluent-loki

Basic Usage

import { Loki, LokiConnector, LokiStorageType } from '@goatlab/fluent-loki'
import { z } from 'zod'

// Define schema
const UserSchema = z.object({
  id: z.string(),
  name: z.string(),
  email: z.string().email(),
  age: z.number().optional()
})

// Create database
const db = Loki.createDb({
  dbName: 'myapp',
  storage: LokiStorageType.memory
})

// Create connector
const users = new LokiConnector({
  entity: { name: 'User' },
  dataSource: db,
  inputSchema: UserSchema,
  outputSchema: UserSchema
})

// Use Fluent API
const user = await users.insert({
  name: 'John Doe',
  email: 'john@example.com',
  age: 30
})

const results = await users.findMany({
  where: { age: { gte: 18 } },
  orderBy: [{ name: 'asc' }],
  limit: 10
})

Key Features

  • In-Memory Performance - Lightning-fast operations ideal for testing and prototyping
  • Multiple Storage Options - Memory, IndexedDB, file system, and encrypted storage
  • Fluent Query Interface - Compatible with all Goat Fluent query patterns
  • Schema Validation - Built-in Zod validation for type safety
  • Complex Queries - Support for nested properties, AND/OR conditions, regex
  • Change Tracking - Monitor document changes with event listeners
  • No External Dependencies - Pure JavaScript implementation

License

MIT

Keywords

typescript

FAQs

Package last updated on 07 Sep 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