README
default-port
Get the default port for a protocol.
Why?
- Translate user input to server config.
- Useful defaults for connecting to services.
- Determine if you can strip the port from a URL.
Install
npm install default-port --save
Usage
Get it into your program.
const defaultPort = require('default-port');
Retrieve the default port for a protocol, as a lowercase string.
const port = defaultPort(
'https', // protocol you want to check
);
console.log(port); // => 443
Contributing
See our contributing guidelines for more details.
- Fork it.
- Make a feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request.
License
Go make something, dang it.