{"id":15680244,"url":"https://github.com/sholladay/default-port","last_synced_at":"2025-10-10T20:02:48.519Z","repository":{"id":29485199,"uuid":"33022437","full_name":"sholladay/default-port","owner":"sholladay","description":"Get the default port for a given protocol.","archived":false,"fork":false,"pushed_at":"2016-05-26T06:26:39.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T00:28:38.590Z","etag":null,"topics":["constants","http","port","protocol","server"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sholladay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-28T05:38:54.000Z","updated_at":"2019-09-23T22:42:25.000Z","dependencies_parsed_at":"2022-08-27T06:11:06.900Z","dependency_job_id":null,"html_url":"https://github.com/sholladay/default-port","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sholladay%2Fdefault-port","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sholladay%2Fdefault-port/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sholladay%2Fdefault-port/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sholladay%2Fdefault-port/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sholladay","download_url":"https://codeload.github.com/sholladay/default-port/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245500588,"owners_count":20625613,"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":["constants","http","port","protocol","server"],"created_at":"2024-10-03T16:41:08.417Z","updated_at":"2025-10-10T20:02:43.479Z","avatar_url":"https://github.com/sholladay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# default-port\n\n\u003e Get the default port for a protocol.\n\n## Why?\n\n - Translate user input to server config.\n - Useful defaults for connecting to services.\n - Determine if you can strip the port from a URL.\n\n## Install\n\n```sh\nnpm install default-port --save\n```\n\n## Usage\n\nGet it into your program.\n\n```js\nconst defaultPort = require('default-port');\n```\n\nRetrieve the default port for a protocol, as a lowercase string.\n\n```js\nconst port = defaultPort(\n    'https',  // protocol you want to check\n);\nconsole.log(port);  // =\u003e 443\n```\n\n## Contributing\n\nSee our [contributing guidelines](https://github.com/sholladay/default-port/blob/master/CONTRIBUTING.md \"The guidelines for participating in this project.\") for more details.\n\n1. [Fork it](https://github.com/sholladay/default-port/fork).\n2. Make a feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. [Submit a pull request](https://github.com/sholladay/default-port/compare \"Submit code to this project for review.\").\n\n## License\n\n[MPL-2.0](https://github.com/sholladay/default-port/blob/master/LICENSE \"The license for default-port.\") © [Seth Holladay](http://seth-holladay.com \"Author of default-port.\")\n\nGo make something, dang it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsholladay%2Fdefault-port","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsholladay%2Fdefault-port","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsholladay%2Fdefault-port/lists"}