Skip to content

parseProcArgv

parseProcArgv(raw): readonly string[]

Defined in: packages/core/src/kernel/lib/proc-parsers.ts:109

Parse the contents of /proc/<pid>/argv into an argv array.

string

Raw file contents from /proc/<pid>/argv.

readonly string[]

Readonly array of argv tokens in order; empty when input is blank.

Format: one argument per line, trailing newline (procFS convention). An empty or whitespace-only input returns [] — the parser does not throw on a process that has no argv yet.

import { parseProcArgv } from '@fishnet/core'
const argv = parseProcArgv('sh\n-c\necho hi\n')
// argv === ['sh', '-c', 'echo hi']

parseProcStatus