1.0.0 • Published 4 years ago

ts-journalctl v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

TS-Journalctl

TypeScript library of the journalctl tool included in Linux distributions.

API

import or require the module and create a new instance:

Import

import Journalctl from 'ts-journalctl';

Require

const Journalctl = require('ts-journalctl');

Create a New Instance

const journalctl = new Journalctl([opts])

The optional object object can be have the following properties.

  • identifier: Show entries with the specified syslog identifier
  • unit: Show logs from the specified unit
  • all: Show all fields, including long and unprintable
  • lines: Show entries with the specified syslog identifier
  • since: Show entries not older than the specified date
  • utc: Express time in Coordinated Universal Time (UTC)

Event: 'event'

It is triggered at each log event and returns the object event that describes the event.

journalctl.on('event', (event: IJournalEvent) => {
    console.log(event);
})

Method: stop

Stops journalctl stream.

journalctl.stop();
1.0.0

4 years ago