{"id":28921132,"url":"https://github.com/itsnickbarry/on-process-exit","last_synced_at":"2026-05-20T14:34:47.836Z","repository":{"id":298612934,"uuid":"1000478031","full_name":"ItsNickBarry/on-process-exit","owner":"ItsNickBarry","description":"🚪 Run callbacks on Node process exit","archived":false,"fork":false,"pushed_at":"2025-06-12T00:54:05.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-22T06:07:14.479Z","etag":null,"topics":["callback","event","events","exit","handler","node","nodejs","process","wow"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ItsNickBarry.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-11T21:09:12.000Z","updated_at":"2025-06-12T00:54:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"2958456e-100b-486d-a71f-33f1cf096425","html_url":"https://github.com/ItsNickBarry/on-process-exit","commit_stats":null,"previous_names":["itsnickbarry/on-process-exit"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ItsNickBarry/on-process-exit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsNickBarry%2Fon-process-exit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsNickBarry%2Fon-process-exit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsNickBarry%2Fon-process-exit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsNickBarry%2Fon-process-exit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ItsNickBarry","download_url":"https://codeload.github.com/ItsNickBarry/on-process-exit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItsNickBarry%2Fon-process-exit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265098887,"owners_count":23711217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["callback","event","events","exit","handler","node","nodejs","process","wow"],"created_at":"2025-06-22T06:07:04.044Z","updated_at":"2026-05-20T14:34:47.776Z","avatar_url":"https://github.com/ItsNickBarry.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# on-process-exit\n\nRegister handlers to be run on process exit.\n\n## Installation\n\n```bash\nnpm install --save on-process-exit\n```\n\n## Usage\n\nRegister a handler:\n\n```typescript\nimport { registerExitHandler } from 'on-process-exit';\n\nregisterExitHandler(() =\u003e console.log('exiting'));\n```\n\nDeregister a handler:\n\n```typescript\nimport { registerExitHandler, deregisterExitHandler } from 'on-process-exit';\n\nconst handlerId = registerExitHandler(() =\u003e console.log('exiting'));\n\nderegisterExitHandler(handlerId);\n```\n\nRespond to different exit event types:\n\n```typescript\nimport { registerExitHandler } from 'on-process-exit';\n\nregisterExitHandler((event) =\u003e console.log(`exiting with event: ${event}`));\n```\n\n## Development\n\nInstall dependencies via pnpm:\n\n```bash\npnpm install\n```\n\nSetup Husky to format code on commit:\n\n```bash\npnpm prepare\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsnickbarry%2Fon-process-exit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsnickbarry%2Fon-process-exit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsnickbarry%2Fon-process-exit/lists"}