# iftop

> runs and parses iftop output into js objects

Latest version **2.0.1** (published 2017-09-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install iftop
pnpm add iftop
yarn add iftop
bun add iftop
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2017-09-05 |
| First published | 2017-08-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Mike Smiley |
| Maintainers | msmiley |

## Links

- npm: https://www.npmjs.com/package/iftop
- Repository: https://github.com/msmiley/iftop
- Homepage: https://github.com/msmiley/iftop#readme
- Issues: https://github.com/msmiley/iftop/issues
- npm.io page: https://npm.io/package/iftop

## Dependencies (2)

- [pty.js](https://npm.io/package/pty.js.md) ^0.3.1
- [smiley](https://npm.io/package/smiley.md) ^2.0.0

## Recent versions

- 2.0.1 (latest) — 2017-09-05
- 2.0.0 — 2017-09-05
- 1.1.4 — 2017-08-30
- 1.1.3 — 2017-08-30
- 1.1.1 — 2017-08-30
- 1.1.0 — 2017-08-30
- 1.0.2 — 2017-08-30
- 1.0.1 — 2017-08-30
- 1.0.0 — 2017-08-30

## README

# iftop

Use the power and speed of [iftop](http://www.ex-parrot.com/pdw/iftop/) to get flow rates and totals of traffic incident on a network device.

Note that the user running this process will need capture permissions on the specified device.

Examples of how this is typically done:

linux:

```bash
sudo setcap cap_net_raw,cap_net_admin=eip /usr/sbin/iftop
```

macOS:

```bash
sudo chmod +r /dev/bpf*
```

## Usage

```js
var IftopParser = require('iftop');

IftopParser.iftopPath = "/usr/sbin/iftop"; // only if iftop is not on the path

var iftop = new IftopParser("eth0");

# set up error handler
iftop.on('error', (e) => {
    console.error(e);
});

# set up data handler
iftop.on('data', (d) => {
    console.log(d);
});

iftop.start();

# optional manipulations after start() has been called (these are passed to iftop)
iftop.toggleAggregateSrc();
iftop.toggleAggregateDst();
iftop.toggleDNSResolution();
iftop.togglePortDisplay();

```

## License

ISC

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