logpare

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 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: ^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 --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.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.mjs

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);

The package ships both ESM and CommonJS builds, so require('logpare') works too.

Next Steps