1.3.5 • Published 1 year ago

linux-top-parser v1.3.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Usage

there are 2 ways to use this package

  • API
  • CLI

API

Installation

npm i linux-top-parser -S

Code

const { parseTopInfo, topInfoTransform } = require("linux-top-parser");

// normal string parsing
const topInfo = parseTopInfo(TOP_INFO_STRING);

// or using transform stream
createReadStream(TOP_FILE_PATH)
    .pipe(topInfoTransform({
        stringify: true
    }))
    .pipe(process.stdout)

Examples

There are 2 code examples shown in the example folder on how to use this package

CLI

the CLI can be pipe from the output of top command

top -b | npx linux-top-parser

or you can use the JSON processor CLI ( jq ) to process the stream

top -b | npx linux-top-parser | jq ".[0].summaryDisplay"

Usage

linux-top-parser [options]

Options:
  -V, --version   output the version number
  -s, --summary   output summary display only (default: false)
  -p, --prettify  output top info with indentation and color (default: false)
  -f, --filter    output process that has > 0% of CPU usage only (default: false)
  -h, --help      display help for command

Reference

1.3.5

1 year ago

1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago