{"id":16800193,"url":"https://github.com/abiosoft/node-graceful","last_synced_at":"2025-08-02T02:34:42.756Z","repository":{"id":57252968,"uuid":"53660071","full_name":"abiosoft/node-graceful","owner":"abiosoft","description":"Gracefully shutdown your node app. Graceful interrupts SIGTERM and SIGINT signals.","archived":false,"fork":false,"pushed_at":"2016-03-16T10:15:47.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-12T21:42:07.354Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/abiosoft.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}},"created_at":"2016-03-11T10:41:00.000Z","updated_at":"2017-03-20T14:31:24.000Z","dependencies_parsed_at":"2022-08-31T22:20:10.841Z","dependency_job_id":null,"html_url":"https://github.com/abiosoft/node-graceful","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abiosoft/node-graceful","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiosoft%2Fnode-graceful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiosoft%2Fnode-graceful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiosoft%2Fnode-graceful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiosoft%2Fnode-graceful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abiosoft","download_url":"https://codeload.github.com/abiosoft/node-graceful/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiosoft%2Fnode-graceful/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268327816,"owners_count":24232747,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-13T09:31:26.835Z","updated_at":"2025-08-02T02:34:42.736Z","avatar_url":"https://github.com/abiosoft.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# graceful-terminate\nGracefully shutdown your node app. Graceful interrupts `SIGTERM` and `SIGINT` signals.\n\n### Usage\n```js\nvar graceful = require(\"graceful-terminate\");\n```\nCleanup before exit.\n```js\ngraceful.add(() =\u003e console.log(\"Cleaning up.\"));\n```\n```sh\n^CCleaning up.\n$\n```\nPrevent shutdown. Return `true` in the function.\n```js\ngraceful.add(() =\u003e {\n    ... // check some conditions\n    if (notReady()){\n        console.log(\"Cannot terminate yet\");\n        return true; // don't shutdown.\n    }\n    return false; // shutdown\n});\n```\n```sh\n^CCannot terminate yet.\n```\nYou can add multiple functions. Return `true` in any function to prevent shutdown and stop executing other functions.\n```js\ngraceful.add(() =\u003e console.log(\"Cleaning up.\"));\ngraceful.add(() =\u003e {\n    console.log(\"Shutdown stops here.\");\n    return true;\n}\ngraceful.add(() =\u003e console.log(\"Won't get here\"));\n```\n```sh\n^CCleaning up.\nShutdown stops here.\n```\n\n### License\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabiosoft%2Fnode-graceful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabiosoft%2Fnode-graceful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabiosoft%2Fnode-graceful/lists"}