{"id":14969208,"url":"https://github.com/gquittet/graceful-server","last_synced_at":"2025-05-15T02:05:52.471Z","repository":{"id":40050530,"uuid":"241244174","full_name":"gquittet/graceful-server","owner":"gquittet","description":"Tiny (~5k), KISS, dependency-free Node.JS library to make your API more graceful","archived":false,"fork":false,"pushed_at":"2025-05-03T12:10:01.000Z","size":1102,"stargazers_count":311,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-08T18:44:36.619Z","etag":null,"topics":["docker","dockerfile","expressjs","fastify","graceful","graceful-server","health-check","kiss","kubernetes","liveness","nodejs","probes","readiness","server","tiny"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gquittet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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},"funding":{"github":["gquittet"],"custom":["https://www.paypal.me/gquittet"]}},"created_at":"2020-02-18T01:20:29.000Z","updated_at":"2025-05-08T07:27:33.000Z","dependencies_parsed_at":"2024-05-22T23:24:57.981Z","dependency_job_id":"fe5a11a3-35fd-4397-9bd3-55e8067c0d63","html_url":"https://github.com/gquittet/graceful-server","commit_stats":{"total_commits":221,"total_committers":4,"mean_commits":55.25,"dds":0.04524886877828049,"last_synced_commit":"168c13b4d458a0144ac78ee9aa11b4815d57a44f"},"previous_names":[],"tags_count":69,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gquittet%2Fgraceful-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gquittet%2Fgraceful-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gquittet%2Fgraceful-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gquittet%2Fgraceful-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gquittet","download_url":"https://codeload.github.com/gquittet/graceful-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259370,"owners_count":22040819,"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":["docker","dockerfile","expressjs","fastify","graceful","graceful-server","health-check","kiss","kubernetes","liveness","nodejs","probes","readiness","server","tiny"],"created_at":"2024-09-24T13:41:21.842Z","updated_at":"2025-05-15T02:05:52.452Z","avatar_url":"https://github.com/gquittet.png","language":"TypeScript","funding_links":["https://github.com/sponsors/gquittet","https://www.paypal.me/gquittet","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=JN3XLTQCX3NR8\u0026source=url"],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  🚀 Graceful Server 🐢\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/package-json/v/gquittet/graceful-server?style=flat\" alt=\"GitHub package.json version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://standardjs.com\" target=\"_blank\" rel=\"noopener\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat\" alt=\"JavaScript Style Guide\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@gquittet/graceful-server\" target=\"_blank\" rel=\"noopener\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/types/@gquittet/graceful-server\" alt=\"npm type definitions\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@gquittet/graceful-server\" target=\"_blank\" rel=\"noopener\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/l/@gquittet/graceful-server\" alt=\"License\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@gquittet/graceful-server\" target=\"_blank\" rel=\"noopener\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dw/@gquittet/graceful-server\" alt=\"npmjs download\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=JN3XLTQCX3NR8\u0026source=url\" target=\"_blank\" rel=\"noopener\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Donate-PayPal-green.svg\" alt=\"Donate with PayPal\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  Tiny (~5k), KISS, dependency-free Node.JS library to make your Rest API graceful.\n\u003c/p\u003e\n\n---\n\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n  - [NPM](#npm)\n  - [PNPM](#pnpm)\n  - [YARN](#yarn)\n- [Endpoint](#endpoint)\n  - [/live](#live)\n  - [/ready](#ready)\n- [Example](#example)\n- [API Doc](#api-doc)\n- [Integration with Docker](#integration-with-docker)\n- [Integration with Kubernetes](#integration-with-kubernetes)\n- [Thanks](#thanks)\n- [Sponsors](#sponsors)\n- [Donate](#donate)\n\n## Features\n\n✔ It's listening system events to gracefully close your API on interruption.\n\n✔ It facilitates the disconnect of data sources on shutdown.\n\n✔ It facilitates the use of liveness and readiness.\n\n✔ It manages the connections of your API.\n\n✔ It avoid boilerplate codes.\n\n✔ Kubernetes compliant.\n\n✔ Dependency-free.\n\n✔ KISS code base.\n\n## Requirements\n\n✔ NodeJS \u003e= 18.0\n\n## Installation\n\n### NPM\n\n```\nnpm install --save @gquittet/graceful-server\n```\n\n### PNPM\n\n```\npnpm add @gquittet/graceful-server\n```\n\n### YARN\n\n```\nyarn add @gquittet/graceful-server\n```\n\n## Endpoint\n\nBelow you can find the default endpoint but you can setup or disable them. To do that, check out the [Options](#options) part.\n\n\u003ca name=\"lightship-behaviour-live\"\u003e\u003c/a\u003e\n\n### \u003ccode\u003e/live\u003c/code\u003e\n\nThe endpoint responds:\n\n- `200` status code with the uptime of the server in second.\n\n```json\n{ \"uptime\": 42 }\n```\n\nUsed to configure liveness probe.\n\n\u003ca name=\"lightship-behaviour-ready\"\u003e\u003c/a\u003e\n\n### \u003ccode\u003e/ready\u003c/code\u003e\n\nThe endpoint responds:\n\n- `200` status code if the server is ready.\n\n```json\n{ \"status\": \"ready\" }\n```\n\n- `503` status code with an empty response if the server is not ready (started, shutting down, etc).\n\n## Example\n\nSee: [EXAMPLE.md](./docs/EXAMPLE.md)\n\n## API Doc\n\nSee: [API.md](./docs/API.md)\n\n## Integration with Docker\n\nSee: [DOCKER.md](./docs/DOCKER.md)\n\n## Integration with Kubernetes\n\nSee: [KUBERNETES.md](./docs/KUBERNETES.md)\n\n## Thanks\n\n★ [Terminus](https://github.com/godaddy/terminus)\n\n★ [Lightship](https://github.com/gajus/lightship)\n\n★ [Stoppable](https://github.com/hunterloftis/stoppable)\n\n★ [Bret Fisher](https://github.com/BretFisher) for his great articles and videos\n\n★ [IBM documentation](https://cloud.ibm.com/docs/node?topic=nodejs-node-healthcheck)\n\n★ [Node HTTP documentation](https://nodejs.org/api/http.html)\n\n★ [Cloud Health](https://github.com/CloudNativeJS/cloud-health)\n\n★ [Cloud Health Connect](https://github.com/CloudNativeJS/cloud-health-connect)\n\n## Sponsors\n\n\u003ca href=\"https://jb.gg/OpenSource\" target=\"_blank\"\u003e\n\n![JetBrains Logo](assets/sponsors/jetbrains.svg)\n\n\u003c/a\u003e\n\n## Donate\n\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=JN3XLTQCX3NR8\u0026source=url)\n\nIf you like my job, don't hesitate to contribute to this project! ❤️\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgquittet%2Fgraceful-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgquittet%2Fgraceful-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgquittet%2Fgraceful-server/lists"}