{"id":24493097,"url":"https://github.com/open-node/graceful","last_synced_at":"2025-08-02T11:33:00.912Z","repository":{"id":57133379,"uuid":"224557154","full_name":"open-node/graceful","owner":"open-node","description":"Node.js process reload graceful","archived":false,"fork":false,"pushed_at":"2021-04-01T10:24:18.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-16T13:13:33.619Z","etag":null,"topics":["graceful","graceful-reload","process","reload"],"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/open-node.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":"2019-11-28T02:49:29.000Z","updated_at":"2021-04-01T10:24:21.000Z","dependencies_parsed_at":"2022-09-03T15:02:52.884Z","dependency_job_id":null,"html_url":"https://github.com/open-node/graceful","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/open-node/graceful","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-node%2Fgraceful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-node%2Fgraceful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-node%2Fgraceful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-node%2Fgraceful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-node","download_url":"https://codeload.github.com/open-node/graceful/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-node%2Fgraceful/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268378965,"owners_count":24240907,"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":["graceful","graceful-reload","process","reload"],"created_at":"2025-01-21T19:19:04.260Z","updated_at":"2025-08-02T11:33:00.870Z","avatar_url":"https://github.com/open-node.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @open-node/graceful\nNode.js process reload graceful\n\n[![Build status](https://travis-ci.com/open-node/graceful.svg?branch=master)](https://travis-ci.org/open-node/graceful)\n[![codecov](https://codecov.io/gh/open-node/graceful/branch/master/graph/badge.svg)](https://codecov.io/gh/open-node/graceful)\n\n# Installation\n\u003cpre\u003enpm i @open-node/graceful --save\u003c/pre\u003e\n\n# Usage\n* your node.js process code\n\u003cpre\u003e\nconst Graceful = require('@open-node/graceful');\n\n// defined loginfo handle function\nconst info = console.log\n\nconst graceful = Graceful(info);\n\n// get process status, false when existing unless will be true\nconst status = graceful.enabled()\n\n// regist callback when process exit\ngraceful.exit(() =\u003e {\n  // will be called when process exit\n});\n\n// wrap function, Once the function is executed, the process will not exit until the function is executed\nconst wrapped = graceful.runner(willBeWrappedFn);\nwrapped(); // Once the function is executed, the process will not exit until the function is executed\n\n// graceful.runnerAsync is the asynchronous version of runner\nconst wrapped = graceful.runner(willBeWrappedAsyncFn);\nawait wrapped(); // Once the function is executed, the process will not exit until the function is executed\n\u003c/pre\u003e\n\n\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n### Table of Contents\n\n-   [Graceful][1]\n    -   [Parameters][2]\n    -   [exit][3]\n        -   [Parameters][4]\n    -   [runner][5]\n        -   [Parameters][6]\n    -   [runnerAsync][7]\n        -   [Parameters][8]\n    -   [enabled][9]\n\n## Graceful\n\n### Parameters\n\n-   `info` **[function][10]** log info output\n\nReturns **Tick** Instance\n\n### exit\n\nregist event listenner for exiting\n\n#### Parameters\n\n-   `listenner` **[function][10]**\n\nReturns **void**\n\n### runner\n\nWrap the function sync version.\nOnce the be wrapped function is executed,\nthe process will not exit until the function is executed\n\n#### Parameters\n\n-   `fn` **[function][10]** will be wrapped fn\n\nReturns **[function][10]** Be wrapped function\n\n### runnerAsync\n\nWrap the function asynchronous version,\nOnce the be wrapped function is executed,\nthe process will not exit until the function is executed\n\n#### Parameters\n\n-   `fn` **AsyncFunction** will be wrapped fn (asynchronous)\n\nReturns **[function][10]** Be warpped function\n\n### enabled\n\nThe process status\n\nReturns **[boolean][11]** status\n\n[1]: #graceful\n\n[2]: #parameters\n\n[3]: #exit\n\n[4]: #parameters-1\n\n[5]: #runner\n\n[6]: #parameters-2\n\n[7]: #runnerasync\n\n[8]: #parameters-3\n\n[9]: #enabled\n\n[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function\n\n[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-node%2Fgraceful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-node%2Fgraceful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-node%2Fgraceful/lists"}