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#
npm install sverloThe package is plain JavaScript with type definitions: no native modules and no compiler. After installing, check that the version is what you expect:
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:
npm install --global sverlo
sverlo --versionOne-off run without installing:
npx sverlo parse access.log --format nginx-combined --limit 5All flags are listed in the CLI reference.
Check it works#
Create a file sample.log and parse it:
2026-10-01T09:14:07Z ERROR db: connection reset by peer attempt=3
2026-10-01T09:14:08Z INFO db: reconnected attempt=4sverlo parse sample.log --pattern "{ts:iso} {level:level} {msg:rest}" --out jsonTwo JSON objects mean the installation works. Next: the quick start.