Module for raw exec output for the server-state project
npm install @server-state/raw-module
!GitHub


!module type: official
A module for the server-state project.
This module allows running "raw" terminal commands and getting their output to
stdout and stderr. Commands do not get run in chronological order and each
command may only get run once per SM.
options, the raw-module SMF takes an array of commands (string[])js
serverState.registerModule('raw', require('@server-state/raw-module'), [
'ls',
'whoami',
'echo Hello'
]);
`It then returns the outputs of these commands in a key-value-pair object where
the commands serve as keys (this is also the reason why duplicate commands
aren't allowed).
Example return object:
`json
{
"ls":{"stdout":"[...]","stderr":"","cmd":"ls","code":0},
"whoami":{"stdout":"[...]","stderr":"","cmd":"whoami","code":0},
"echo Hello":{"stdout":"Hello","stderr":"","cmd":"echo Hello","code":0}
}
``