{"id":15899147,"url":"https://github.com/prozi/euthanasia","last_synced_at":"2025-07-26T13:32:57.962Z","repository":{"id":177929291,"uuid":"661118775","full_name":"Prozi/euthanasia","owner":"Prozi","description":"when your node.js process uses too much memory, allow it to gracefully exit","archived":false,"fork":false,"pushed_at":"2024-08-20T10:58:26.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T05:53:22.274Z","etag":null,"topics":["graceful-shutdown","memory-management","node-js","oom","out-of-memory"],"latest_commit_sha":null,"homepage":"","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/Prozi.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":"2023-07-01T21:08:17.000Z","updated_at":"2024-08-20T10:58:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"592ba4ea-f2f4-45a3-8354-799230492cea","html_url":"https://github.com/Prozi/euthanasia","commit_stats":null,"previous_names":["prozi/euthanasia"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prozi%2Feuthanasia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prozi%2Feuthanasia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prozi%2Feuthanasia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prozi%2Feuthanasia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Prozi","download_url":"https://codeload.github.com/Prozi/euthanasia/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244126801,"owners_count":20402179,"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":["graceful-shutdown","memory-management","node-js","oom","out-of-memory"],"created_at":"2024-10-06T10:11:16.689Z","updated_at":"2025-07-26T13:32:57.950Z","avatar_url":"https://github.com/Prozi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# euthanasia\n\nwhen your node.js process uses too much memory or cpu, allow it to gracefully exit\n\n## usage:\n\n```js\nconst euthanasia = require('euthanasia');\n\neuthanasia({\n  memory: 100,      // 100 MB limit\n  cpu: 80,          // 80% CPU limit\n  interval: 10000,  // check every 10 seconds\n  // called when either memory or CPU limit is exceeded\n  ready: async ({ memory, cpu }) =\u003e {\n    // your logic here\n    if (memory) {\n      console.log(`Memory limit exceeded: ${memory} MB`);\n    }\n    if (cpu) {\n      console.log(`CPU limit exceeded: ${cpu.toFixed(2)}%`);\n    }\n    // You can return false to skip exit (e.g., wait for cleanup)\n    return true;\n  }\n});\n```\n\n## install:\n\n```bash\nnpm i euthanasia --save\n```\n\n## license:\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprozi%2Feuthanasia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprozi%2Feuthanasia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprozi%2Feuthanasia/lists"}