This package has been deprecated

Author message:

Package not mantained

is-port

0.1.2Β β€’Β PublicΒ β€’Β Published

isPort

Build Status code style: prettier Downloads stability-stable

βœ… Check if a number is a valid port respecting the IANA Service Name and Transport Protocol Port Number Registry. Because I always forget if the last is 65535? 65534? xD.

demo

🎁 Ping me on Twitter if you like this project

Install

β˜• Install latest Node.js stable version (or LTS) and then:

npm i -g is-port

Use

πŸ“ More examples are provided in the test folder.

import { isPort } from "is-port";

console.log(isPort(5)); // true
console.log(isPort(10000000)); // false

Contributing

😎 If you wanted to help please take a look to this file.

API

πŸ‘€ Full method definition.

isPort(port) -> valid

Checks if the passed number is a valid port.

  • port (number) - Candidate to check.
  • valid (boolean) - Result of the validation.

Readme

Keywords

Package Sidebar

Install

npm i is-port

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

5.95 kB

Total Files

5

Last publish

Collaborators

  • jesusprubio