Registry / observability / log-bundler

log-bundler

JSON →
library0.5.4jsnpmunverified

A JavaScript/TypeScript library that collects multiple log messages and emits them as a single JSON log line. Version 0.5.4 is the latest stable release; the project is pre-1.0.0 with documentation promised at 1.0.0. It simplifies structured logging by buffering logs and flushing them as a batch, ideal for reducing I/O in high-throughput Node.js applications. Simpler than full-featured frameworks like Winston or Pino, but limited in features and currently lacks comprehensive docs.

npm install log-bundler
INSTALL
IMPORT
SIG · LOG-BUNDLER
L
log-bundler
observabilityjavascriptv0.5.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

LogBundler
import { LogBundler } from 'log-bundler'
const LogBundler = require('log-bundler').LogBundler
The library exports LogBundler as a named export. Default import is not supported.
createLogBundler
import { createLogBundler } from 'log-bundler'
const createLogBundler = require('log-bundler').default
Helper function to create a LogBundler instance. Not a default export.
LogBundlerOptions
import type { LogBundlerOptions } from 'log-bundler'
import { LogBundlerOptions } from 'log-bundler' (when only type used)
Type import available for TypeScript users. Avoid value import at runtime.

Show how to create a LogBundler, add individual logs, and flush them as a batch JSON log.

import { LogBundler } from 'log-bundler'; const bundler = new LogBundler({ batchSize: 10, flushInterval: 1000, level: 'info' }); bundler.log('info', 'This is a log message', { userId: 123 }); bundler.log('error', 'An error occurred', { errorCode: 500 }); // Manually flush to write bundled logs bundler.flush();
Debug
Known issues
gotchaPre-1.0.0 API may break in minor versions. Semantic versioning not guaranteed.
fix
Pin to exact version or prepare for breaking changes.
affects: <1.0.0
deprecatedCertain configuration options (e.g., 'outputFile') may be removed in future releases.
fix
Use standard output streams instead of custom output file option.
affects: >=0.3.0
gotchaCalling flush() synchronously may emit logs asynchronously; ensure proper await if flush returns a promise.
fix
Use 'await bundler.flush()' if flush() returns a promise.
affects: >=0.4.0
breakingVersion 0.5.0 changed the export from default to named exports. 'require('log-bundler')' no longer returns a constructor.
fix
Use 'import { LogBundler } from 'log-bundler'' or 'const { LogBundler } = require('log-bundler')'.
affects: >=0.5.0
gotchaLog levels are case-sensitive and must be lowercase ('info', 'error'). Using uppercase 'INFO' will not filter correctly.
fix
Always use lowercase level strings.
affects: >=0.5.0
Errors
Common errors & fixes
TypeError: log_bundler_1.default is not a constructor
Using default import in ESM with older version (<0.5.0) or incorrect import style.
fix
Use named import: import { LogBundler } from 'log-bundler'
ERR_REQUIRE_ESM
Using require() with an ESM-only package version.
fix
Use import syntax or convert your project to ESM. Alternatively, for CommonJS, use dynamic import: const { LogBundler } = await import('log-bundler')
Cannot find module 'log-bundler'
Package not installed or incorrect import path.
fix
Run: npm install log-bundler
Property 'log' does not exist on type 'typeof import(...)'
TypeScript not recognizing instance methods due to wrong import (importing the class instead of an instance).
fix
Instantiate LogBundler first: const bundler = new LogBundler(); then call bundler.log()
Upgrade
Version history
0.5.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
2
Resources
log-bundler — npm install log-bundler · libregistry