Installation
Install logpare globally, per-project, or run it with npx, and confirm the install works.
logpare can be installed as a CLI tool (for command-line usage) or as a library (for programmatic usage in your projects).
As a CLI Tool
Install globally to use the logpare command from anywhere:
npm install -g logpareVerify the installation:
logpare --versionNow you can compress logs directly:
logpare server.log
cat /var/log/syslog | logpareAs a Library
Install locally in your project for programmatic usage:
npm install logpareOr with pnpm:
pnpm add logpareOr with yarn:
yarn add logpareUsing CLI with Local Install
If you installed logpare locally (not globally), use npx to run the CLI:
npx logpare server.log
cat /var/log/syslog | npx logpareRequirements
- Node.js:
^22.0.0 || >=24.0.0. Node 20 reached end of life and is no longer supported; CI tests against 22, 24, and 26.
Check your Node version:
node --versionVerify Installation
CLI Verification
logpare --helpYou should see the help message with all available options.
Library Verification
Create a test file test-logpare.mjs:
import { compress } from 'logpare';
const logs = [
'INFO Connection established',
'INFO Connection established',
'ERROR Connection failed',
];
const result = compress(logs);
console.log(result.formatted);Run it:
node test-logpare.mjsYou should see compressed output with templates.
TypeScript Support
logpare is written in TypeScript and includes full type definitions. No additional @types package is needed.
import { compress, type CompressionResult } from 'logpare';
const result: CompressionResult = compress(logs);The package ships both ESM and CommonJS builds, so require('logpare') works too.
Next Steps
- Quick Start Guide - Learn basic usage
- API Reference - Explore the API
- CLI Reference - Command-line options