Installation
Install logpare as a CLI tool or library
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: Version 20.0 or higher (22.x or 24.x recommended)
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.js:
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.jsYou 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);Next Steps
- Quick Start Guide - Learn basic usage
- API Reference - Explore the API
- CLI Reference - Command-line options