{"id":16032850,"url":"https://github.com/silverwind/parse-listen-string","last_synced_at":"2026-04-21T02:10:57.938Z","repository":{"id":57688060,"uuid":"472724590","full_name":"silverwind/parse-listen-string","owner":"silverwind","description":"Parse a HTTP server listen string","archived":false,"fork":false,"pushed_at":"2024-04-13T19:09:14.000Z","size":968,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T09:49:00.208Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/silverwind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-22T10:51:54.000Z","updated_at":"2024-07-11T13:10:42.157Z","dependencies_parsed_at":"2023-01-29T16:31:35.033Z","dependency_job_id":"b0307d7a-53a2-48e6-a48e-78cb5c426c58","html_url":"https://github.com/silverwind/parse-listen-string","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"50e9e15390025750660d1efea0364363cf4c3220"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Fparse-listen-string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Fparse-listen-string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Fparse-listen-string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silverwind%2Fparse-listen-string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silverwind","download_url":"https://codeload.github.com/silverwind/parse-listen-string/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221700442,"owners_count":16866073,"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-10-08T21:40:52.083Z","updated_at":"2026-04-21T02:10:57.892Z","avatar_url":"https://github.com/silverwind.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parse-listen-string\n[![](https://img.shields.io/npm/v/parse-listen-string.svg?style=flat)](https://www.npmjs.org/package/parse-listen-string) [![](https://img.shields.io/npm/dm/parse-listen-string.svg)](https://www.npmjs.org/package/parse-listen-string)\n\nNode.js module to parse a listen string like `0.0.0.0:443`.\n\n## Install\n\n```bash\nnpm i parse-listen-string\n```\n\n## Usage\n```js\nimport {parseListenString} from \"parse-listen-string\";\n\nparseListenString(\"0.0.0.0:80\")\n//=\u003e {host: \"0.0.0.0\", port: 80, proto: \"http\"}\n\nparseListenString(\"https://[::1]:443\")\n//=\u003e {host: \"::1\", port: 443, proto: \"https\"}\n```\n\n## API\n### parseListenString(listenString)\n\n* `listenString` *String* or *Number*: A listen string to parse\n\nReturns a object or `null` if string can not be parsed. Object properties:\n\n- `proto` *String*. Protocol, either `http` or `https`\n- `host` *String*: Listen host in form of an IP address\n- `port` *Number*: Listen port\n- `path` *String*: Unix socket path, this is mutual exclusive with `host` and `port`\n\n© [silverwind](https://github.com/silverwind), distributed under BSD licence\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilverwind%2Fparse-listen-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilverwind%2Fparse-listen-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilverwind%2Fparse-listen-string/lists"}