
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
automatically
Advanced tools
Automatically pick available ports and run any dev server - zero config, just prefix your command
Zero-config port management - just prefix your command and run any dev server without port conflicts
Stop crashing into existing servers! automatically finds available ports and runs your dev servers automatically - no code changes needed.
npm install -g automatically
npm install automatically
Just prefix any dev server command with automatically:
# React / Create React App
automatically npm start
# Next.js
automatically npm run dev
automatically next dev
# Express / Node
automatically node server.js
automatically npm start
# Python
automatically python manage.py runserver
automatically python -m http.server
# Any framework
automatically <your-command>
How it works:
PORT environment variablePORT env variableExample output:
$ automatically npm start
✨ Found available port: 3001
🚀 Starting: npm start
> my-app@1.0.0 start
> react-scripts start
Compiled successfully!
Server running on http://localhost:3001
# Start any server
automatically npm start
automatically node app.js
automatically next dev
automatically python -m http.server
# View help
automatically
automatically --help
Run multiple dev servers without conflicts:
# Terminal 1
automatically npm start # → Port 3000
# Terminal 2
automatically npm start # → Port 3001 (auto-picks next)
# Terminal 3
automatically next dev # → Port 3002
You can also use automatically as a library in your code:
npm install automatically
const automatically = require('automatically');
// Find next available port (starts from 3000)
const port = await automatically();
console.log(`Server running on port ${port}`);
// Start from a specific port
const port = await automatically(5000);
const express = require('express');
const automatically = require('automatically');
const app = express();
automatically(3000).then(port => {
app.listen(port, () => {
console.log(`Server running on http://localhost:${port}`);
});
});
Full TypeScript support included!
import automatically, { PortOptions } from 'automatically';
const port: number = await automatically(3000);
const options: PortOptions = {
start: 3000,
end: 9000,
host: 'localhost'
};
const port2: number = await automatically(options);
automatically(startPort?)Find the next available port starting from startPort (default: 3000).
const port = await automatically(); // Start from 3000
const port = await automatically(5000); // Start from 5000
automatically(options)Find port with advanced options.
const port = await automatically({
start: 3000, // Start port (default: 3000)
end: 9999, // End port (default: 9999)
host: '127.0.0.1' // Host to check (default: '127.0.0.1')
});
automatically.check(port, host?)Check if a specific port is available.
const isAvailable = await automatically.check(3000);
console.log(isAvailable); // true or false
automatically.ports(count, options?)Get multiple available ports.
const ports = await automatically.ports(3, { start: 4000 });
console.log(ports); // [4000, 4001, 4002]
automatically.kill(port)Kill the process running on a specific port (cross-platform).
await automatically.kill(3000);
console.log('Port 3000 is now free');
# Work on multiple projects simultaneously
cd ~/project-a
automatically npm start # Runs on 3000
cd ~/project-b
automatically npm start # Runs on 3001
cd ~/project-c
automatically next dev # Runs on 3002
const express = require('express');
const automatically = require('automatically');
const app = express();
app.get('/', (req, res) => {
res.send('Hello World!');
});
automatically(3000).then(port => {
app.listen(port, () => {
console.log(`Express server running on http://localhost:${port}`);
});
});
const automatically = require('automatically');
async function startServers() {
const ports = await automatically.ports(3, { start: 3000 });
ports.forEach((port, index) => {
// Start your servers on each port
console.log(`Server ${index + 1} on port ${port}`);
});
}
startServers();
const automatically = require('automatically');
async function start() {
const targetPort = 3000;
// Kill any process on the port
await automatically.kill(targetPort);
// Now start your server
app.listen(targetPort, () => {
console.log(`Server running on port ${targetPort}`);
});
}
start();
PORT environment variable to the available portPORT and uses it automaticallyautomatically checks ports by attempting to bind a server to each port. If a port is available, it returns immediately. If not, it tries the next port until it finds one that's free.
Works with any framework that respects the PORT environment variable:
process.env.PORTport=os.getenv('PORT')process.env.PORT or os.getenv('PORT')MIT
Issues and PRs welcome at https://github.com/gzew/automatically
FAQs
Automatically pick available ports and run any dev server - zero config, just prefix your command
We found that automatically demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.