Skip to content
Sections
LanguageRUEN

v2.1Getting started

Install

How to install Sverlo with npm, verify the installation and use the CLI.

Node.js versions

Sverlo 2.x runs on Node.js 20 and newer. The 1.x branch supports Node.js 14 and up but only receives security fixes.

The library#

bash
npm install sverlo

The package is plain JavaScript with type definitions: no native modules and no compiler. After installing, check that the version is what you expect:

bash
node -e "import('sverlo').then(m => console.log(m.version))"

Use import { createParser } from 'sverlo' in ESM. From CommonJS, version 2 needs a dynamic import(); there is no synchronous require, the reason is in the migration guide.

Command line#

The sverlo command is installed together with the package. A global install is only needed when you run it outside a project:

bash
npm install --global sverlo
sverlo --version

One-off run without installing:

bash
npx sverlo parse access.log --format nginx-combined --limit 5

All flags are listed in the CLI reference.

Check it works#

Create a file sample.log and parse it:

log
2026-10-01T09:14:07Z ERROR db: connection reset by peer attempt=3
2026-10-01T09:14:08Z INFO db: reconnected attempt=4
bash
sverlo parse sample.log --pattern "{ts:iso} {level:level} {msg:rest}" --out json

Two JSON objects mean the installation works. Next: the quick start.

Updated: