{"id":15939723,"url":"https://github.com/binarykitchen/amazing-grace","last_synced_at":"2025-04-03T20:21:48.975Z","repository":{"id":25310213,"uuid":"28736871","full_name":"binarykitchen/amazing-grace","owner":"binarykitchen","description":"A tiny ExpressJS middleware for a sweet, graceful shutdown procedure","archived":false,"fork":false,"pushed_at":"2024-03-26T10:26:40.000Z","size":15,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T01:03:18.223Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/binarykitchen.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":"2015-01-03T06:28:29.000Z","updated_at":"2024-02-11T18:59:34.000Z","dependencies_parsed_at":"2024-10-29T13:29:16.897Z","dependency_job_id":null,"html_url":"https://github.com/binarykitchen/amazing-grace","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":0.09090909090909094,"last_synced_commit":"d38283fa4f61c722fc2247d06377518c7c50b103"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binarykitchen%2Famazing-grace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binarykitchen%2Famazing-grace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binarykitchen%2Famazing-grace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binarykitchen%2Famazing-grace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binarykitchen","download_url":"https://codeload.github.com/binarykitchen/amazing-grace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247071071,"owners_count":20878611,"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":[],"created_at":"2024-10-07T06:20:57.606Z","updated_at":"2025-04-03T20:21:48.950Z","avatar_url":"https://github.com/binarykitchen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"amazing-grace\n=============\n\n[![Build Status](https://travis-ci.org/binarykitchen/amazing-grace.svg?branch=master)](https://travis-ci.org/binarykitchen/amazing-grace)\n\nA tiny middleware for a sweet graceful shutdown procedure. Just listen to amazing Grace while closing the app. Existing connections will be respected during a configurable timeout while new ones are being refused.\n\nThis middleware is recommended if you want to harden your nodejs app for zero down time during production.\n\n## Example\n\n```js\nvar amazingGrace    = require('amazing-grace'),\n    express         = require('express'),\n\n    app    = express(),\n    server = http.createServer(app)\n\n// Pass on server instance, required parameter\napp.use(amazingGrace(server))\n```\n\n## What happens on app.kill('...')?\n\nA graceful shutdown procedure is being initiated, asking the server to close and forcing to close all existing connections after a given `timeout` so that they have a chance to i.E. save data before oblivion.\n\nDuring that timeout, new connections to the server won't be possible. After that timeout `process.kill(...)` is called and the server is shut down.\n\n## Options (example)\n\n```js\napp.use(amazingGrace(server, {log: console.log, timeout: 50}))\n```\n\n### log\n\nDefault: none\n\nIf you wish more debug information, you can pass on the log function directly i.E. `console.log` or even `bunyan.info.bind(bunyan)`, whatever log level you wish. Use of bind() is recommended.\n\n### timeout\n\nDefault: 100ms\n\nDepending on your app performance you might want to increase that to make sure no data loss occurs between restarts.\n\n## License\n\nMIT. Copyright (C) [Michael Heuberger](https://binarykitchen.com)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarykitchen%2Famazing-grace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinarykitchen%2Famazing-grace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarykitchen%2Famazing-grace/lists"}