Title: util: process signal to exit code utility by ErickWendel · Pull Request #60963 · nodejs/node · GitHub
Open Graph Title: util: process signal to exit code utility by ErickWendel · Pull Request #60963 · nodejs/node
X Title: util: process signal to exit code utility by ErickWendel · Pull Request #60963 · nodejs/node
Description: Description Adds util.convertProcessSignalToExitCode() utility function to convert signal names (e.g., SIGTERM, SIGKILL) to their corresponding POSIX exit codes. When a child process is terminated by a signal, the code parameter in the 'exit' and 'close' events is null. This utility allows users to convert the signal parameter to the POSIX standard exit code. Example import { spawn } from 'node:child_process'; import { once } from 'node:events'; import { convertProcessSignalToExitCode } from 'node:util'; const ls = spawn('ls', ['-lh', '/usr']); ls.kill(); const [code, signal] = await once(ls, 'exit'); const exitCode = convertProcessSignalToExitCode(signal); console.log(`signal ${signal}, POSIX exit code: ${exitCode}`); // signal SIGTERM, POSIX exit code: 143 Note: While Windows doesn't natively support POSIX signals, Node.js provides a cross-platform abstraction that emulates signal behavior. This allows convertProcessSignalToExitCode() to work consistently across all platforms, returning the same POSIX exit codes on both Unix-like systems and Windows. Refs #60285 #60720
Open Graph Description: Description Adds util.convertProcessSignalToExitCode() utility function to convert signal names (e.g., SIGTERM, SIGKILL) to their corresponding POSIX exit codes. When a child process is terminated ...
X Description: Description Adds util.convertProcessSignalToExitCode() utility function to convert signal names (e.g., SIGTERM, SIGKILL) to their corresponding POSIX exit codes. When a child process is terminated ...
Opengraph URL: https://github.com/nodejs/node/pull/60963
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:d0dcfd46-fb6d-3800-48b4-7275492a3f0f |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C902:70BDC:3DAFD6:547E03:6A4C7EC3 |
| html-safe-nonce | 16d017e9f04c1f53acce1b064096566a9cf85fbd0f47e31830dcdbcc1a78eb5a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTAyOjcwQkRDOjNEQUZENjo1NDdFMDM6NkE0QzdFQzMiLCJ2aXNpdG9yX2lkIjoiNzIwOTIxNDc0NTQyMDUyOTM0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8618da327809d614ae3f650e7c2440eef25d994bcbdf8228be7429c0d8c31ffb |
| hovercard-subject-tag | pull_request:3075671929 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/nodejs/node/pull/60963/files |
| twitter:image | https://avatars.githubusercontent.com/u/8060102?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/8060102?s=400&v=4 |
| og:image:alt | Description Adds util.convertProcessSignalToExitCode() utility function to convert signal names (e.g., SIGTERM, SIGKILL) to their corresponding POSIX exit codes. When a child process is terminated ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cd470457e909b9d062f8002cf438ba870e6acff6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width