{"id":13836144,"url":"https://github.com/hemerajs/fastify-graceful-shutdown","last_synced_at":"2025-04-06T18:17:35.356Z","repository":{"id":25696043,"uuid":"104639702","full_name":"hemerajs/fastify-graceful-shutdown","owner":"hemerajs","description":"Gracefully shutdown fastify","archived":false,"fork":false,"pushed_at":"2024-08-30T05:42:52.000Z","size":1332,"stargazers_count":75,"open_issues_count":4,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T16:13:13.026Z","etag":null,"topics":["fastify","fastifyjs-plugin","graceful"],"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/hemerajs.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}},"created_at":"2017-09-24T11:43:35.000Z","updated_at":"2025-02-03T15:18:47.000Z","dependencies_parsed_at":"2024-07-18T13:46:37.324Z","dependency_job_id":"93fc969e-0fd2-4150-a8f6-8777cbdec352","html_url":"https://github.com/hemerajs/fastify-graceful-shutdown","commit_stats":{"total_commits":73,"total_committers":7,"mean_commits":"10.428571428571429","dds":0.1095890410958904,"last_synced_commit":"e0e9beff9302d003dd963ea3ec47c57ad5ca70c5"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemerajs%2Ffastify-graceful-shutdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemerajs%2Ffastify-graceful-shutdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemerajs%2Ffastify-graceful-shutdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemerajs%2Ffastify-graceful-shutdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hemerajs","download_url":"https://codeload.github.com/hemerajs/fastify-graceful-shutdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247526768,"owners_count":20953143,"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":["fastify","fastifyjs-plugin","graceful"],"created_at":"2024-08-04T15:00:36.677Z","updated_at":"2025-04-06T18:17:35.337Z","avatar_url":"https://github.com/hemerajs.png","language":"JavaScript","funding_links":[],"categories":["\u003ch2 align=\"center\"\u003eAwesome Fastify\u003c/h2\u003e","JavaScript"],"sub_categories":["\u003ch2 align=\"center\"\u003eEcosystem\u003c/h2\u003e"],"readme":"# 🏹 fastify-graceful-shutdown\n\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](#badge)\n[![NPM version](https://img.shields.io/npm/v/fastify-graceful-shutdown.svg?style=flat)](https://www.npmjs.com/package/fastify-graceful-shutdown)\n\nShutdown [Fastify](https://github.com/fastify/fastify) graceful asynchronously. By default the fastify `close` hook is called when `SIGINT` or `SIGTERM` was triggered.\n\n## Features\n\n- Graceful and debug friendly shutdown\n- Flush the fastify logger before process exit to avoid losing logs\n- Handlers are called in parallel for faster shutdown\n\n## Install\n\n```bash\nnpm install --save fastify-graceful-shutdown\n```\n\n## Register plugin\n\n```js\nfastify.register(require('fastify-graceful-shutdown'))\n```\n\n## Usage\n\n```js\nfastify.after(() =\u003e {\n  fastify.gracefulShutdown(async (signal) =\u003e {\n    fastify.log.info('Received signal to shutdown: %s', signal)\n    await doSomethingAsync()\n  })\n})\n```\n\n## Compatibility\n\nFastify \u003e=3\n\n## Caveats\n\n- Don't register signal handlers otherwise except with this plugin.\n- Can't be used with a different logger other than [Pino](https://github.com/pinojs/pino) because we use the child logger feature to encapsulate the logs.\n- Use fastify `onClose` hook to release resources in your plugin.\n- The process will be exited after a certain timeout (Default 10 seconds) to protect against stuck process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemerajs%2Ffastify-graceful-shutdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhemerajs%2Ffastify-graceful-shutdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemerajs%2Ffastify-graceful-shutdown/lists"}