Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

portastic

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

portastic

Programmatically find open ports with Node.js

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

#Portastic

Programmatically find open ports with Node.js

Installation

To install Portastic you can simply use NPM:

npm install portastic
Usage

Finding all opened doors within a range:

port = require('portastic');

options = {
	min : 8000,
	mas : 8005
}

port.find(options, function(err, data){
	if(err)
		throw err;
	console.log(data);
});

If you wan't to retrieve just one or more doors you can pass it in the options:

options = {
	min : 8000,
	max : 8005,
	retrieve : 1
}

You can also test ports:

port.test(80, function(err, data){
	if(err)
		throw err;

	if(data == false)
		console.log('The port isn\'t opened.');
	else
		console.log('The port is opened!');
});

If you wan't to test an array of door, you sure can:

port.test([80, 93, 8001, 22], function(err, data){
	if(err)
		throw err;

	// 'data' will be an array with the opened doors only
	console.log('Opened doors:', data);
});
Command line

You can use Portastic in the command line too:

npm install -g portastic

This will install portastic globally, now it's up to you to call it. Display the help with:

portastic -h
Tests

If you wan't to run tests on portastic locally you will need to follow this steps:

cd /path/to/portastic/folder
npm install vows
npm test

FAQs

Package last updated on 16 Jul 2012

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc