@mahsumurebe/journalctl
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Typescript 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 '@mahsumurebe/journalctl';

Require

const Journalctl = require('@mahsumurebe/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
  • units: Show logs from the specified unit(s)
  • userUnits: Show logs from the specified user unit(s)
  • 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();

Package Sidebar

Install

npm i @mahsumurebe/journalctl

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

17.1 kB

Total Files

8

Last publish

Collaborators

  • mahsumurebe