https://github.com/silic0ns0ldier/darwin-libproc-nodejs
High-level interface over darwin's libproc library.
https://github.com/silic0ns0ldier/darwin-libproc-nodejs
darwin libproc nodejs
Last synced: 3 months ago
JSON representation
High-level interface over darwin's libproc library.
- Host: GitHub
- URL: https://github.com/silic0ns0ldier/darwin-libproc-nodejs
- Owner: Silic0nS0ldier
- Created: 2023-04-08T03:32:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-30T13:06:34.000Z (about 3 years ago)
- Last Synced: 2025-10-24T09:58:21.279Z (9 months ago)
- Topics: darwin, libproc, nodejs
- Language: Rust
- Homepage:
- Size: 872 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `@silicon-soldier/darwin-libproc`
High-level interface over darwin's `libproc` library.
## Usage
### `pidPath`
```js
import libproc from "@silicon-soldier/darwin-libproc";
// Current process (immune to `process.execPath` manipulation)
console.info(libproc.pidPath(process.pid));
// /opt/homebrew/Cellar/node@16/16.19.1/bin/node
// Parent process
console.info(libproc.pidPath(process.ppid));
// /bin/zsh
// PID 1 (launchd)
console.info(libproc.pidPath(1));
// /sbin/launchd
```
## Status
### C-to-Rust Binding
The crate `darwin-libproc-sys@0.2.0` houses the C-to-Rust bindings.
| `libproc.h` | |
| - | - |
| `proc_listpidspath` | ✓ |
| `proc_listpids` | ✓ |
| `proc_listallpids` | ✗ |
| `proc_listpgrppids` | ✗ |
| `proc_listchildpids` | ✗ |
| `proc_pidinfo` | ✓ |
| `proc_pidfdinfo` | ✓ |
| `proc_pidfileportinfo` | ✗ |
| `proc_name` | ✓ |
| `proc_regionfilename` | ✓ |
| `proc_kmsgbuf` | ✓ |
| `proc_pidpath` | ✓ |
| `proc_libversion` | ✓ |
| `proc_setpcontrol` | ✗ |
| `proc_track_dirty` | ✗ |
| `proc_set_dirty` | ✗ |
| `proc_get_dirty` | ✗ |
| `proc_terminate` | ✗ |
### NodeJS Binding
The crate `darwin-libproc@0.2.0` acts as a safe and idiomatic wrapper over `darwin-libproc-sys@0.2.0`. This package exposes this API to NodeJS.
| `darwin-libproc@0.2.0` | |
| - | - |
| `all_pids` | ✗ |
| `name` | ✗ |
| `pgrp_only_pids` | ✗ |
| `pid_cwd` | ✗ |
| `pid_path` | `pidPath` |
| `pid_rusage` | ✗ |
| `ppid_only_pids` | ✗ |
| `ruid_only_pids` | ✗ |
| `task_all_info` | ✗ |
| `task_info` | ✗ |
| `tty_only_pids` | ✗ |
| `uid_only_pids` | ✗ |
| `version` | ✗ |
| `vnode_path_info` | ✗ |
## See Also
- [@silicon-soldier/windows-psapi](https://github.com/Silic0nS0ldier/windows-psapi-nodejs) for Windows
- `proc/{pid}/` for Linux