{"id":49523959,"url":"https://github.com/raininfall/callback-sandbox","last_synced_at":"2026-05-02T01:36:36.653Z","repository":{"id":57193027,"uuid":"72174652","full_name":"raininfall/callback-sandbox","owner":"raininfall","description":"a function wrapper to avoid exception pop to top","archived":false,"fork":false,"pushed_at":"2016-10-28T08:55:35.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-02T01:36:16.306Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/raininfall.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":"2016-10-28T04:56:48.000Z","updated_at":"2016-10-28T07:04:26.000Z","dependencies_parsed_at":"2022-09-01T06:01:14.755Z","dependency_job_id":null,"html_url":"https://github.com/raininfall/callback-sandbox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/raininfall/callback-sandbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raininfall%2Fcallback-sandbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raininfall%2Fcallback-sandbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raininfall%2Fcallback-sandbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raininfall%2Fcallback-sandbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raininfall","download_url":"https://codeload.github.com/raininfall/callback-sandbox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raininfall%2Fcallback-sandbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32520156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"ssl_error","status_checked_at":"2026-05-02T01:12:54.261Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-05-02T01:36:35.716Z","updated_at":"2026-05-02T01:36:36.637Z","avatar_url":"https://github.com/raininfall.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# callback-sandbox\n[![build status](https://travis-ci.org/RainInFall/callback-sandbox.svg?branch=master)](https://travis-ci.org/RainInFall/callback-sandbox)\n[![coverage](https://coveralls.io/repos/github/RainInFall/callback-sandbox/badge.svg)](https://coveralls.io/github/RainInFall/callback-sandbox?branch=master)\n\nA function wrapper to avoid exception pop to top, or callback when timeout\n\n## Installation\n```bash\n$ npm install callback-sandbox\n```\n\n## Example\n```javascript\nvar sandbox = createSandbox(function onError(err){\n  //Handle error\n  console.log(err);//something wrong\n}, 2000/*timeout*/);\n\nsetTimeout(sandbox(function(err){\n  throw new Error(\"something wrong\");\n}, 1000);\n```\n\n## API\n### createSandbox([onError][timeout])\n* **onError** Call whem an unhandle exception occur in sandbox\n* **timeout** Default timeout of sandbox\n\nCreate a sandbox.\n\n\n### sandbox(fn, [timeout])\n* **fn** Function to run in the sandbox\n* **timeout** Timeout for this run.\nRun function in sandbox and start timeout.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraininfall%2Fcallback-sandbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraininfall%2Fcallback-sandbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraininfall%2Fcallback-sandbox/lists"}