Socket
Book a DemoInstallSign in
Socket

port-validator

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

port-validator

A port number formatting validator.

0.1.0-beta1
latest
Source
npmnpm
Version published
Weekly downloads
269
-38.3%
Maintainers
1
Weekly downloads
 
Created
Source

node-port-validator

Latest NPM release NPM Downloads TravisCI Build Status Test Coverage Code Climate License Dependencies Dev Dependencies Greenkeeper badge

Table of Contents

Synopsis

A port formatting validator.

Usage

   const {portValidator} = require('port-validator');

   portValidator('172.17.0.5').validate(); # false -> is not a port.
   portValidator(-256).validate(); # false -> is not a port.
   portValidator('66789').validate(); # false -> is not a port.

   portValidator('80').validate(); # true -> is a port.
   portValidator(443).validate(); # true -> is a port.

Installation

npm install port-validator

API Reference

Please refer to API documentation.

Tests

Run unit tests

npm test

Compatibility

Node

Tested using Node v9.5.0.

Browser

Untested at this time.

Issues

Feel free to submit issues and enhancement requests.

Contributing

Please refer to project's style guidelines and guidelines for submitting patches and additions. In general, we follow the "fork-and-pull" Git workflow.

  • Fork the repo on GitHub
  • Clone the project to your own machine
  • Commit changes to your own branch
  • Push your work back up to your fork
  • Submit a Pull request so that we can review your changes

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

Credits

History

v0.1.0-alpha1 (2018-02-08)

Initial version.

License

The MIT License

Copyright (c) 2018 SAS 9 Février

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

port

FAQs

Package last updated on 08 Feb 2018

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.