@lanterna-profiler/core
v2.1.0
Published
Agent-first Node.js CPU, memory & experimental async profiler — headless capture + analysis primitives
Readme
@lanterna-profiler/core
Headless capture + analysis primitives for Lanterna — agent-first Node.js CPU, memory & experimental async profiler.
This package is TTY-free: no spinner, no prompts, no process listing. It exposes the orchestration APIs you need to capture profile data, run an analysis pipeline, and build a LanternaReport. Bring your own analyzers, or install @lanterna-profiler/detectors for the default detector pack.
Install
npm install @lanterna-profiler/core
# Add the default detector pack if you want built-in CPU/memory/async findings
npm install @lanterna-profiler/detectorsUsage
import { runProfile } from '@lanterna-profiler/core';
import { createCpuProfileKindWithBuiltInDetectors } from '@lanterna-profiler/detectors';
const report = await runProfile({
command: ['node', 'app.js'],
durationMs: 15_000,
pretty: false,
kinds: [
createCpuProfileKindWithBuiltInDetectors({
readStderrSoFar: () => '',
sampleIntervalMicros: 1000,
deep: false,
}),
],
});Documentation
- Programmatic API —
runProfile,attachProfile, low-levelrunCapture+ pipeline. - Report schema —
LanternaReport(schema v2). - Architecture — capture flow, modes, enrichment.
- Writing a profile kind.
- Writing a detector.
Related packages
@lanterna-profiler/cli—lanternabinary built on top of this package.@lanterna-profiler/detectors— default detector pack and plugin helpers.
