@orvo/node
v0.0.0
Published
Lightweight, high-performance logging SDK for Node.js
Maintainers
Readme
@orvo/node
Lightweight, high-performance logging SDK for Node.js.
Installation
npm install @orvo/node
# or
pnpm add @orvo/node
# or
yarn add @orvo/nodeQuick Start
import { orvo, log } from '@orvo/node';
// Initialize the SDK
orvo.init({
apiKey: process.env.ORVO_API_KEY!,
service: 'my-app',
});
// Use the log singleton
log.info('Hello, Orvo!');
log.warn('Something might be wrong', { userId: 123 });
log.error('An error occurred', { error: err });
// Graceful shutdown
process.on('SIGTERM', async () => {
await orvo.shutdown();
process.exit(0);
});API Reference
orvo.init(config)
Initialize the SDK with your configuration.
orvo.init({
apiKey: string; // Required: Your API key
service: string; // Required: Your service name
endpoint?: string; // Optional: Custom endpoint (default: "https://ingest.orvo.dev")
environment?: string; // Optional: Environment (default: "production")
batchSize?: number; // Optional: Max events before auto-flush (default: 100)
flushInterval?: number; // Optional: Flush interval in ms (default: 5000)
debug?: boolean; // Optional: Enable debug logging (default: false)
});log
The global log singleton. Available methods:
log.debug(message, data?)
log.info(message, data?)
log.warn(message, data?)
log.error(message, data?)
log.fatal(message, data?)orvo.flush()
Manually flush buffered logs.
await orvo.flush();orvo.shutdown()
Gracefully shutdown the SDK, flushing remaining logs.
await orvo.shutdown();orvo.isInitialized()
Check if the SDK is initialized.
if (!orvo.isInitialized()) {
orvo.init({ ... });
}TypeScript
Full TypeScript support is included. Import types as needed:
import type { LogLevel, LogEvent, OrvoConfig, Logger, Transport } from '@orvo/node';License
ISC
