# stream-log-stats

> Prints statistics from the incoming web log stream to the console

Latest version **3.0.2** (published 2019-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install stream-log-stats
pnpm add stream-log-stats
yarn add stream-log-stats
bun add stream-log-stats
```

Provides the command `log-stats`.

## 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 | 3.0.2 |
| Published | 2019-11-07 |
| First published | 2014-06-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 7 |
| Unpacked size | 9.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Lloyd Brookes |
| Maintainers | 75lb |
| Keywords | web, log, stats, stream, statistics, view |

## Links

- npm: https://www.npmjs.com/package/stream-log-stats
- Repository: https://github.com/75lb/stream-log-stats
- Homepage: https://github.com/75lb/stream-log-stats#readme
- Issues: https://github.com/75lb/stream-log-stats/issues
- npm.io page: https://npm.io/package/stream-log-stats

## Dependencies (7)

- [byte-size](https://npm.io/package/byte-size.md) ^6.2.0
- [JSONStream](https://npm.io/package/JSONStream.md) ^1.3.5
- [stream-via](https://npm.io/package/stream-via.md) ^1.0.4
- [table-layout](https://npm.io/package/table-layout.md) ~1.0.0
- [lodash.throttle](https://npm.io/package/lodash.throttle.md) ^4.1.1
- [common-log-format](https://npm.io/package/common-log-format.md) ^1.0.0
- [ansi-escape-sequences](https://npm.io/package/ansi-escape-sequences.md) ^5.1.2

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 3.0.2 (latest) — 2019-11-07
- 3.0.1 — 2019-06-16
- 3.0.0 — 2019-06-06
- 2.0.2 — 2017-06-01
- 2.0.1 — 2017-06-01
- 2.0.0 — 2017-03-20
- 1.1.7 — 2016-07-20
- 1.1.6 — 2016-06-25
- 1.1.5 — 2016-06-25
- 1.1.4 — 2016-06-07
- 1.1.3 — 2016-02-26
- 1.1.2 — 2015-12-30
- 1.1.1 — 2015-11-29
- 1.1.0 — 2015-11-20
- 1.1.0-2 — 2015-11-20
- … 18 more at https://npm.io/package/stream-log-stats/versions

## README

[![view on npm](http://img.shields.io/npm/v/stream-log-stats.svg)](https://www.npmjs.org/package/stream-log-stats)
[![npm module downloads](http://img.shields.io/npm/dt/stream-log-stats.svg)](https://www.npmjs.org/package/stream-log-stats)
[![Dependency Status](https://badgen.net/david/dep/75lb/stream-log-stats)](https://david-dm.org/75lb/stream-log-stats)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)

# stream-log-stats

Presents a dynamic view of the incoming [common log format](http://en.wikipedia.org/wiki/Common_Log_Format) data to the console. The view is refreshed as new data streams in.

## Installation

Mac / Linux users may need to run the install commands with `sudo`.

### As a library

Move into your project directory then run:
```sh
$ npm install stream-log-stats --save
```

#### Example

```js
var connect = require('connect')
var morgan = require('morgan') // logging middleware
var http = require('http')
var logStats = require('stream-log-stats')

var app = connect()
app.use(morgan({ stream: logStats() }))

var server = http.createServer(app).listen(8000)
```

### As a command-line app

From any directory run the following:
```sh
$ npm install -g stream-log-stats
```

Now the `log-stats` utility is installed. Pipe in a common-log-format log to view the statistics.

#### Example

This example pipes the output from [local-web-server](https://www.npmjs.org/package/local-web-server) into `log-stats`.
```
$ ws -f common | log-stats
serving at http://localhost:8000
Clients  Requests  Transferred
1        48        2.79 MB

Extension          Requests  Transferred
.jpg               16        690.24 KB
.woff              7         1.39 MB
.css               6         128.84 KB
.js                4         311.44 KB
.png               3         16.93 KB
.3                 3         130.17 KB
.ttf               3         63.71 KB
.map               3         35.81 KB
.html              2         29.59 KB
<none>             1         19.96 KB

Resource                                                   Requests  Transferred
/_gh-pages/assets/images/75lb.png                          3         16.93 KB
...t-awesome-4.0.3/fonts/fontawesome-webfont.woff?v=4.0.3  3         130.17 KB
/_gh-pages/assets/fonts//Lombardic.ttf                     3         63.71 KB
/_gh-pages/assets/fonts/PTSansWeb/PTS76F_W.woff            3         535.03 KB
...s/assets/fonts/font-awesome-4.0.3/css/font-awesome.css  3         63.45 KB
/_gh-pages/assets/styles/screen.css                        3         65.39 KB
/_gh-pages/assets/styles/screen.css.map                    3         35.81 KB
/_gh-pages/assets/images/thumb/present-continuous.jpg      2         49.53 KB
/_gh-pages/assets/images/thumb/past-simple.jpg             2         82.27 KB
/_gh-pages/assets/fonts/PTSansWeb/PTS75F_W.woff            2         465.52 KB
```

* * *

&copy; 2015-19 Lloyd Brookes \<75pound@gmail.com\>.

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