stream-log-stats
Advanced tools
Comparing version 2.0.2 to 3.0.0
#!/usr/bin/env node | ||
'use strict' | ||
const statsView = require('../') | ||
var statsView = require('../') | ||
process.stdin.pipe(statsView({ refreshRate: 100 })) |
@@ -1,2 +0,1 @@ | ||
'use strict' | ||
const path = require('path') | ||
@@ -6,3 +5,3 @@ const urlUtil = require('url') | ||
const stats = module.exports = { | ||
const stats = { | ||
clients: {}, | ||
@@ -82,1 +81,3 @@ clientCount: 0, | ||
} | ||
module.exports = stats |
@@ -1,7 +0,1 @@ | ||
'use strict' | ||
const ansi = require('ansi-escape-sequences') | ||
const Table = require('table-layout') | ||
exports.render = render | ||
let visible = false | ||
@@ -11,2 +5,4 @@ let previouslyRenderedLines = 0 | ||
function render (stats) { | ||
const Table = require('table-layout') | ||
const ansi = require('ansi-escape-sequences') | ||
const clientsTable = new Table([ | ||
@@ -73,1 +69,3 @@ { | ||
} | ||
exports.render = render |
{ | ||
"name": "stream-log-stats", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "2.0.2", | ||
"version": "3.0.0", | ||
"description": "Prints statistics from the incoming web log stream to the console", | ||
"repository": "https://github.com/75lb/stream-log-stats.git", | ||
"license": "MIT", | ||
"main": "./lib/stream-log-stats.js", | ||
"bin": { | ||
@@ -21,19 +20,24 @@ "log-stats": "bin/cli.js" | ||
"engines": { | ||
"node": ">=4.0.0" | ||
"node": ">=8.0.0" | ||
}, | ||
"scripts": { | ||
"test": "test-runner test/*.js" | ||
"test": "test-runner test.js" | ||
}, | ||
"devDependencies": { | ||
"test-runner": "^0.3.0" | ||
"test-runner": "^0.6.0" | ||
}, | ||
"dependencies": { | ||
"JSONStream": "^1.3.1", | ||
"ansi-escape-sequences": "^3.0.0", | ||
"byte-size": "^3.0.0", | ||
"common-log-format": "~0.1.3", | ||
"JSONStream": "^1.3.5", | ||
"ansi-escape-sequences": "^4.1.0", | ||
"byte-size": "^5.0.1", | ||
"common-log-format": "~0.1.4", | ||
"lodash.throttle": "^4.1.1", | ||
"stream-via": "^1.0.3", | ||
"table-layout": "~0.4.0" | ||
} | ||
"stream-via": "^1.0.4", | ||
"table-layout": "~0.4.4" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"lib", | ||
"bin" | ||
] | ||
} |
[![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://david-dm.org/75lb/stream-log-stats.svg)](https://david-dm.org/75lb/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: | ||
@@ -19,2 +22,3 @@ ```sh | ||
#### Example | ||
```js | ||
@@ -33,2 +37,3 @@ var connect = require('connect') | ||
### As a command-line app | ||
From any directory run the following: | ||
@@ -42,2 +47,3 @@ ```sh | ||
#### Example | ||
This example pipes the output from [local-web-server](https://www.npmjs.org/package/local-web-server) into `log-stats`. | ||
@@ -77,2 +83,2 @@ ``` | ||
© 2015-17 Lloyd Brookes \<75pound@gmail.com\>. | ||
© 2015-19 Lloyd Brookes \<75pound@gmail.com\>. |
Sorry, the diff of this file is not supported yet
16232
81
8
172
+ Addedansi-escape-sequences@4.1.0(transitive)
+ Addedarray-back@3.1.0(transitive)
+ Addedbyte-size@5.0.1(transitive)
- Removedansi-escape-sequences@3.0.0(transitive)
- Removedarray-back@1.0.4(transitive)
- Removedbyte-size@3.0.0(transitive)
UpdatedJSONStream@^1.3.5
Updatedansi-escape-sequences@^4.1.0
Updatedbyte-size@^5.0.1
Updatedcommon-log-format@~0.1.4
Updatedstream-via@^1.0.4
Updatedtable-layout@~0.4.4