logpare

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 logpare

Verify the installation:

logpare --version

Now you can compress logs directly:

logpare server.log
cat /var/log/syslog | logpare

As a Library

Install locally in your project for programmatic usage:

npm install logpare

Or with pnpm:

pnpm add logpare

Or with yarn:

yarn add logpare

Using 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 logpare

Requirements

  • Node.js: Version 20.0 or higher (22.x or 24.x recommended)

Check your Node version:

node --version

Verify Installation

CLI Verification

logpare --help

You 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.js

You 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