Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
alta-portfinder
Advanced tools
$ npm install portfinder
The portfinder
module has a simple interface:
var portfinder = require('portfinder');
portfinder.getPort(function (err, port) {
//
// `port` is guaranteed to be a free port
// in this scope.
//
});
Or with promise (if Promise
s are supported) :
const portfinder = require('portfinder');
portfinder.getPortPromise()
.then((port) => {
//
// `port` is guaranteed to be a free port
// in this scope.
//
})
.catch((err) => {
//
// Could not get a free port, `err` contains the reason.
//
});
If portfinder.getPortPromise()
is called on a Node version without Promise (<4), it will throw an Error unless Bluebird or any Promise pollyfill is used.
By default portfinder
will start searching from 8000
and scan until maximum port number (65535
) is reached.
You can change this globally by setting:
portfinder.setBasePort(3000); // default: 8000
portfinder.setHighestPort(3333); // default: 65535
or by passing optional options object on each invocation:
portfinder.getPort({
port: 3000, // minimum port
stopPort: 3333 // maximum port
}, callback);
$ npm test
FAQs
A simple tool to find an open port on the current machine
The npm package alta-portfinder receives a total of 1 weekly downloads. As such, alta-portfinder popularity was classified as not popular.
We found that alta-portfinder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.