npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

scannet

v1.0.5

Published

端口扫描工具

Downloads

19

Readme

Port Scanner

A simple and efficient port scanner written in Node.js. This utility allows you to scan a range of IP addresses and ports within a specified subnet, checking for open ports.

Features

Subnet Scanning: Scan an entire subnet for open ports. Port Range Parsing: Parse and scan a range of ports (e.g., 3000-3010). Concurrency Control: Control the number of concurrent port scans using a configurable queue. Timeout Handling: Set a timeout for each port scan to avoid hanging on closed or unresponsive ports. Installation To use this port scanner in your project, you need to install the required dependencies:

npm install ip net p-queue
Usage
Importing the Module
First, require the module in your Node.js application:
const { startScan, parseData, scanPort } = require('./path/to/your/module');
Scanning a Subnet
You can scan a subnet by specifying the subnet and a range of ports:
const subnet = '192.168.1.0/24';  // Subnet to scan
const portRange = '3000-3010,80,443';  // Ports to scan

// Start scanning
startScan(subnet, portRange, 50);

Example Output The scan will print output to the console indicating which ports are open or closed:

端口 192.168.1.1:3000 拒绝
端口 192.168.1.1:3001 开放
端口 192.168.1.1:3002 超时

cli

Usage: cli [options]

选项: --version,显示版本号,[布尔]
-s, --subnet,The subnet to scan in CIDR notation (e.g., 192.168.0.0/24), [字符串] [必需]
-p, --ports The ports to scan, can be a single port, comma-separated list, or range (e.g., 80,443 or 1000-2000) [字符串] [必需]
-c, --concurrency The concurrency level for scanning [数字] [默认值: 100]
-h, --help,显示帮助信息 ,[布尔]

示例:

scannet -s 192.168.0.0/24 -p 22,80,443  
#Scan a subnet for open ports

缺少这些必须的选项:subnet, ports

Functions

startScan(subnet, portStr, concurrency) Parameters:

subnet: A string representing the subnet in CIDR notation (e.g., 192.168.1.0/24). portStr: A string representing the range of ports to scan (e.g., '80,443,3000-3010'). concurrency: An optional integer to control the number of concurrent scans (default is 100). Description: Starts scanning the specified subnet for open ports within the given port range.

parseData(dataString) Parameters:

dataString: A string representing a comma-separated list of ports or port ranges (e.g., '80,443,3000-3010'). Returns: An array of integers representing the parsed ports.

Description: Parses the port string into an array of individual port numbers.

scanPort(targetHost, port, timeout) Parameters:

targetHost: A string representing the IP address of the target host. port: An integer representing the port number to scan. timeout: An optional integer to set the scan timeout in milliseconds (default is 1000). Returns: A promise that resolves with an object containing the port and targetHost if the port is open, or null if it is closed or timed out.

Description: Scans a specific port on a target host and checks if it is open, closed, or timed out.

Contributing Feel free to submit issues or pull requests. Contributions are welcome!

License

This project is licensed under the MIT License.