Documentation
¶
Overview ¶
Package process installs a Node-like `process` global on a gojs VM. It is a thin shim over the VM's capability providers — nothing here touches the host directly:
- process.stdout.write / process.stderr.write route through the VM's PrintProvider (the same sink as console), so an embedder that redirects console output to a log or web app captures process output too. Writes are line-buffered (the PrintProvider is line-oriented); a trailing partial line is flushed on process.exit.
- process.exit / cwd / env / platform / arch / pid come from the VM's OsProvider. Without one, those facilities are simply absent — a sandboxed VM cannot exit the host, read its environment, or learn what it runs on.
- process.hrtime uses the TimeProvider; process.nextTick uses the microtask queue.
Only argv is supplied here (the invocation); everything else is a capability the host grants and can intercept.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
Process is a handle to an installed process global. It lets the embedder flush buffered stdout/stderr when the program finishes so a trailing write() with no newline is not lost.
Click to show internal directories.
Click to hide internal directories.