parseProcStatus
parseProcStatus(
raw):ProcStatus
Defined in: packages/core/src/kernel/lib/proc-parsers.ts:68
Parse the contents of /proc/<pid>/status into a ProcStatus.
Parameters
Section titled “Parameters”string
Raw file contents, e.g. the result of reading
/proc/<pid>/status to string.
Returns
Section titled “Returns”A ProcStatus with every known field populated (empty string for missing lines).
Remarks
Section titled “Remarks”procFS speaks newline-delimited text. Each line is key: value; unknown
keys are ignored, and lines without a colon are skipped. Used by ps
and other readers of procFS status files — they share this parser so the
wire format stays consistent across consumers.
Example
Section titled “Example”import { parseProcStatus } from '@fishnet/core'
const status = parseProcStatus([ 'pid: 1', 'ppid: 0', 'state: running', 'uid: 0', 'cwd: /',].join('\n'))// status.state === 'running'