0.1.0 • Published 8 years ago

default-port v0.1.0

Weekly downloads
4
License
MPL-2.0
Repository
github
Last release
8 years ago

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.

  1. Fork it.
  2. Make a feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request.

License

MPL-2.0 © Seth Holladay

Go make something, dang it.

0.1.0

8 years ago

0.0.5

9 years ago

0.0.4

9 years ago