# net-scan

> scan ports & ips

Latest version **0.1.1** (published 2016-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install net-scan
pnpm add net-scan
yarn add net-scan
bun add net-scan
```

Provides the command `scan`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2016-02-23 |
| First published | 2014-05-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | lellansin |
| Maintainers | lellansin |
| Keywords | scan, port |

## Links

- npm: https://www.npmjs.com/package/net-scan
- Repository: https://github.com/Lellansin/node-net-scan
- Homepage: https://github.com/Lellansin/node-net-scan#readme
- Issues: https://github.com/Lellansin/node-net-scan/issues
- npm.io page: https://npm.io/package/net-scan

## Dependencies (3)

- [async](https://npm.io/package/async.md) ^1.2.1
- [progress](https://npm.io/package/progress.md) ~1.1.5
- [commander](https://npm.io/package/commander.md) ^2.2.0

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2016-02-23
- 0.1.0 — 2015-06-19
- 0.0.1 — 2015-06-18
- 0.0.0 — 2014-05-09

## README

# Net scan

* scan port
* scan ip

## Installation

```shell
npm install net-scan -g
```

## CLI

```shell
npm test
```

```shell
scan -h github.com -r 1~1000
```

Output:

```shell
scan host: github.com ports 1~1000
port 80 is open
scanning [                    ] 0% 1/1000 	port 22 is open
scanning [                    ] 0% 2/1000 	port 443 is open
scanning [====================] 100% 1000/1000 	
ports scan: 5245ms
open ports: [ 80, 22, 443 ]
```

## Example

### Range scan
```javascript
var scan = require('net-scan');

console.time('ports scan');
scan.port({
	host: 'github.com',
	start: 1,
	end: 1000,
	timeout: 2000,
	queue: 1000
}, function(err, result) {    
	console.timeEnd('ports scan');
	console.log('open ports:', result);
});
```

Output

```shell
ports scan: 2232ms
open ports: [ 22, 80, 443 ]
```

### Ports scan
```javascript
var scan = require('net-scan');

console.time('ports scan');
scan.port({
	host: 'github.com',
	ports: [20, 21, 22, 80, 443, 3306, 27017],
	timeout: 2000
}, function(err, result) {    
	console.timeEnd('ports scan');
	console.log('open ports:', result);
});

```

Output

```shell
ports scan: 2015ms
open ports: [ 443, 22, 80 ]
```

### Listener
```javascript
console.time('ports scan');
scan.port({
		host: 'github.com',
		start: 1,
		end: 1000,
		timeout: 2000,
		queue: 1000
	})
	.on('open', function(port) {
		console.log('found port open', port);
	})
	.on('end', function(port) {
		console.timeEnd('ports scan');
		console.log('scan port over');
	});

```

Output

```shell
found port open 22
found port open 80
found port open 443
ports scan: 2243ms
scan port over
```

## Todo
* scan array ips
* add command.js op

---
_Source: https://npm.io/package/net-scan · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
