{"id":13772485,"url":"https://github.com/Richienb/cross-exit","last_synced_at":"2025-05-11T04:31:26.656Z","repository":{"id":47759930,"uuid":"232784621","full_name":"Richienb/cross-exit","owner":"Richienb","description":"Gracefully terminate a script in Node.js or browsers.","archived":false,"fork":false,"pushed_at":"2021-08-14T05:18:29.000Z","size":454,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T23:47:39.318Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Richienb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":"richienb","open_collective":"richie-bendall","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":"richienb","issuehunt":"richienb","otechie":null,"custom":null}},"created_at":"2020-01-09T10:38:19.000Z","updated_at":"2020-01-09T11:59:27.000Z","dependencies_parsed_at":"2022-09-13T00:14:39.571Z","dependency_job_id":null,"html_url":"https://github.com/Richienb/cross-exit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"Richienb/node-module-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Richienb%2Fcross-exit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Richienb%2Fcross-exit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Richienb%2Fcross-exit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Richienb%2Fcross-exit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Richienb","download_url":"https://codeload.github.com/Richienb/cross-exit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253518941,"owners_count":21921074,"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-08-03T17:01:04.545Z","updated_at":"2025-05-11T04:31:25.060Z","avatar_url":"https://github.com/Richienb.png","language":"JavaScript","readme":"# Cross Exit [![Travis CI Build Status](https://img.shields.io/travis/com/Richienb/cross-exit/master.svg?style=for-the-badge)](https://travis-ci.com/Richienb/cross-exit)\n\nGracefully terminate a script in Node.js or browsers. Works as a drop-in replacement for `process.exit`.\n\n[![NPM Badge](https://nodei.co/npm/cross-exit.png)](https://npmjs.com/package/cross-exit)\n\n## Install\n\n```sh\nnpm install cross-exit\n```\n\n## Strategy\n\nIn Node.js, `cross-exit` uses `process.exit()` and in browsers, `window.onerror` is temporarily set to hide a termination error which is then thrown.\n\n## Usage\n\n```js\nconst exit = require(\"cross-exit\");\n\nconsole.log(\"This message is logged.\");\nexit();\nconsole.log(\"This message isn't logged.\");\n```\n\n## API\n\n### crossExit(code?)\n\n#### code\n\nType: `number`\\\nDefault: `0`\n\nThe exit code.\n","funding_links":["https://patreon.com/richienb","https://opencollective.com/richie-bendall","https://liberapay.com/richienb","https://issuehunt.io/r/richienb"],"categories":["Node.js Features"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRichienb%2Fcross-exit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRichienb%2Fcross-exit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRichienb%2Fcross-exit/lists"}