Registry / devops / logpilot-lite-client

logpilot-lite-client

JSON →
library1.0.1jsnpmunverified

LogPilot-Lite Client is an official TypeScript gRPC client for the LogPilot-Lite log management server, version 1.0.1. It enables Node.js applications to produce and consume logs with automatic offset management. The package ships TypeScript types and supports modern Node.js (20+). Key differentiators include a simple producer/consumer API for streaming logs, built-in offset tracking, and storage options (sqlite as default) for persistent log consumption.

npm install logpilot-lite-client
INSTALL
IMPORT
SIG · LOGPILOT-LITE-CLIE
L
logpilot-lite-client
devopsjavascriptv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LogPilotProducer
import { LogPilotProducer } from 'logpilot-lite-client'
import LogPilotProducer from 'logpilot-lite-client'
This is a named export, not a default export. CommonJS users should use: const { LogPilotProducer } = require('logpilot-lite-client').
LogPilotConsumer
import { LogPilotConsumer } from 'logpilot-lite-client'
import * as logpilot from 'logpilot-lite-client'; const consumer = new logpilot.LogPilotConsumer(...)
LogPilotConsumer is a named export; destructuring is preferred.
LogEntry
import type { LogEntry } from 'logpilot-lite-client'
import { LogEntry } from 'logpilot-lite-client'
LogEntry is a TypeScript type; use type-only import when only using it as a type to avoid runtime inclusion.

Illustrates producing a log entry to a gRPC server and consuming logs with offset management.

import { LogPilotProducer, LogPilotConsumer } from 'logpilot-lite-client'; async function demo() { // Producer: send a log const producer = new LogPilotProducer(process.env.GRPC_SERVER_ADDRESS ?? 'localhost:50051'); await producer.produce({ channel: 'orders', level: 'INFO', message: 'Order created', meta: { userId: 'user-1' } }); // Consumer: read logs const consumer = new LogPilotConsumer({ serverAddress: process.env.GRPC_SERVER_ADDRESS ?? 'localhost:50051', channel: 'orders', consumerId: 'demo-service', storage: 'sqlite' }); const logs = await consumer.consume(10); logs.forEach(log => console.log(log.message)); } demo().catch(console.error);
Debug
Known issues
gotchaThe `produce` method accepts `meta` as an optional field, but the README shows duplicate `meta` keys in the example object (a syntax error). This could cause confusion or runtime errors if copied verbatim.
fix
Ensure `meta` is provided only once in the object: `meta: { userId: 'user-1' }`.
affects: >=1.0.0
breakingNode.js 20+ is required; older versions may not work due to modern language features.
fix
Upgrade Node.js to version 20 or later.
affects: >=1.0.0
gotchaConsumer offset is automatically committed after each consume() call. If processing fails, logs may be skipped.
fix
Implement manual error handling and consider custom offset management if exactly-once processing is required.
affects: >=1.0.0
gotchaThe package depends on gRPC, which may require native compilation. Ensure your environment has build tools installed.
fix
Install regular gRPC dependencies: npm install @grpc/grpc-js @grpc/proto-loader
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'logpilot-lite-client'
Missing installation or incorrect module path.
fix
Run `npm install logpilot-lite-client` and ensure the import path is correct (no extensions or subpaths).
Error: 14 UNAVAILABLE: Connection dropped
gRPC server is not running or unreachable.
fix
Ensure LogPilot-Lite server is running on the configured address (default localhost:50051). Use `serverAddress` option correctly.
TypeError: consumer.consume is not a function
Using incorrect import or older version without consume method.
fix
Use named import `{ LogPilotConsumer }` and ensure version >=1.0.0.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
logpilot-lite-client — npm install logpilot-lite-client · libregistry