{"id":28169697,"url":"https://github.com/kid-joker/serve-then","last_synced_at":"2025-08-15T23:14:11.064Z","repository":{"id":152143152,"uuid":"597587629","full_name":"KID-joker/serve-then","owner":"KID-joker","description":"After the server starts successfully, then you can ...","archived":false,"fork":false,"pushed_at":"2023-04-24T14:10:58.000Z","size":120,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-09T15:49:22.975Z","etag":null,"topics":["server","start","test","testing-tools","wait"],"latest_commit_sha":null,"homepage":"","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/KID-joker.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":"2023-02-05T01:37:28.000Z","updated_at":"2023-05-04T06:35:15.000Z","dependencies_parsed_at":"2023-07-25T20:04:27.622Z","dependency_job_id":null,"html_url":"https://github.com/KID-joker/serve-then","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"866d36f38a37e790494d91671fb0495427e283eb"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KID-joker/serve-then","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KID-joker%2Fserve-then","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KID-joker%2Fserve-then/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KID-joker%2Fserve-then/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KID-joker%2Fserve-then/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KID-joker","download_url":"https://codeload.github.com/KID-joker/serve-then/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KID-joker%2Fserve-then/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270644765,"owners_count":24621332,"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-15T02:00:12.559Z","response_time":110,"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":["server","start","test","testing-tools","wait"],"created_at":"2025-05-15T16:18:39.082Z","updated_at":"2025-08-15T23:14:11.040Z","avatar_url":"https://github.com/KID-joker.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# serve-then\n\n[![NPM version](https://img.shields.io/npm/v/serve-then?color=a1b858\u0026label=)](https://www.npmjs.com/package/serve-then)\n\nInspired by [start-server-and-test](https://github.com/bahmutov/start-server-and-test), but this isn't a cli tool.\nIt will run a server in the **child_process**, and return the **URL**, then you can do what you want. *When the current process ends, the child_process will also end.*\n\n### features\n\n1. Based on and offering all features of [live-server](https://github.com/tapio/live-server), But [it](https://github.com/KID-joker/live-server) has a few changes:\n   - convert start/shutdown into Promise style.\n   - reject if port is specified and already in use. (0 means random)\n2. Ships ESM and CJS bundles.\n3. Can get the server URL.\n4. Destroy child_process following the current process.\n\n### usage\n\n```ts\nimport { serve, serveOptions } from 'serve-then'\n\nserve(options as serveOptions).then(url =\u003e {\n  // serving root at url\n}).catch(err =\u003e {})\n```\n\n### License\n\n[MIT](./LICENSE) License © 2023 [KID-joker](https://github.com/KID-joker)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkid-joker%2Fserve-then","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkid-joker%2Fserve-then","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkid-joker%2Fserve-then/lists"}