Socket
Book a DemoInstallSign in
Socket

default-port

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

default-port

Get the default port for a protocol.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

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

MPL-2.0 © Seth Holladay

Go make something, dang it.

Keywords

js

FAQs

Package last updated on 26 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts