{"id":22311498,"url":"https://github.com/vilicvane/main-function","last_synced_at":"2025-03-26T02:15:20.098Z","repository":{"id":66080650,"uuid":"174845591","full_name":"vilicvane/main-function","owner":"vilicvane","description":"A simple wrapper that handles error and return code.","archived":false,"fork":false,"pushed_at":"2023-10-03T11:17:49.000Z","size":225,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T00:54:54.166Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/vilicvane.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}},"created_at":"2019-03-10T15:53:02.000Z","updated_at":"2023-05-17T18:40:15.000Z","dependencies_parsed_at":"2023-05-28T08:30:39.661Z","dependency_job_id":"7ceef3bb-d83c-447e-a2d3-c87ebb698236","html_url":"https://github.com/vilicvane/main-function","commit_stats":null,"previous_names":["vilicvane/main-function","vilic/main-function"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilicvane%2Fmain-function","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilicvane%2Fmain-function/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilicvane%2Fmain-function/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vilicvane%2Fmain-function/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vilicvane","download_url":"https://codeload.github.com/vilicvane/main-function/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245573891,"owners_count":20637674,"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-12-03T21:20:05.475Z","updated_at":"2025-03-26T02:15:20.065Z","avatar_url":"https://github.com/vilicvane.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM Package](https://badge.fury.io/js/main-function.svg)](https://www.npmjs.com/package/main-function)\n[![Build Status](https://travis-ci.org/vilic/main-function.svg?branch=master)](https://travis-ci.org/vilic/main-function)\n\n# Main Function\n\nA simple wrapper that handles error and return code.\n\n## Install\n\n```sh\nyarn add main-function\n```\n\n## Usage\n\n```ts\nimport main, {ProgramError} from 'main-function';\n\nmain(async (args: string[]) =\u003e {\n  // Throw an `ProgramError` to exit:\n  throw new ProgramError(0, 'Some friendly error message');\n\n  // Or throw a normal error (will print error stack and exit with code `1`):\n  throw new Error():\n\n  // Optional return statement for exit code:\n  return 0;\n});\n```\n\n## License\n\nMIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvilicvane%2Fmain-function","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvilicvane%2Fmain-function","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvilicvane%2Fmain-function/lists"}