From 744c6e3b7f4401042243ea3836190a9894d0e594 Mon Sep 17 00:00:00 2001 From: Lloyd Brookes Date: Tue, 17 Sep 2024 07:41:12 +0100 Subject: [PATCH] deps, dates, CI --- .github/workflows/node.js.yml | 30 ++ .gitignore | 2 - .travis.yml | 5 - LICENSE | 2 +- README.md | 10 +- bin/cli.js | 1 + package-lock.json | 515 +++++++--------------------------- package.json | 21 +- test.js | 12 +- 9 files changed, 156 insertions(+), 442 deletions(-) create mode 100644 .github/workflows/node.js.yml delete mode 100644 .gitignore delete mode 100644 .travis.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..9697de9 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,30 @@ +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + node-version: [12, 14, 16, 18, 20, 22] + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm install + - run: npm i -g @75lb/nature + - run: npm run test diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 713862c..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -tmp -out diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d72655c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - 8 - - 10 - - 12 diff --git a/LICENSE b/LICENSE index 203018f..64202db 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-19 Lloyd Brookes <75pound@gmail.com> +Copyright (c) 2015-25 Lloyd Brookes <75pound@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index bd75825..985b3d0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -[![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) +[![view on npm](https://badgen.net/npm/v/stream-log-stats)](https://www.npmjs.org/package/stream-log-stats) +[![npm module downloads](https://badgen.net/npm/dt/stream-log-stats)](https://www.npmjs.org/package/stream-log-stats) +[![Gihub repo dependents](https://badgen.net/github/dependents-repo/lwsjs/stream-log-stats)](https://github.com/lwsjs/stream-log-stats/network/dependents?dependent_type=REPOSITORY) +[![Gihub package dependents](https://badgen.net/github/dependents-pkg/lwsjs/stream-log-stats)](https://github.com/lwsjs/stream-log-stats/network/dependents?dependent_type=PACKAGE) +[![Node.js CI](https://github.com/lwsjs/stream-log-stats/actions/workflows/node.js.yml/badge.svg)](https://github.com/lwsjs/stream-log-stats/actions/workflows/node.js.yml) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard) # stream-log-stats @@ -77,4 +79,4 @@ Resource Requests Transferred * * * -© 2015-19 Lloyd Brookes \<75pound@gmail.com\>. +© 2015-25 Lloyd Brookes \<75pound@gmail.com\>. diff --git a/bin/cli.js b/bin/cli.js index 49506b2..5e426a5 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -2,3 +2,4 @@ const statsView = require('../') process.stdin.pipe(statsView({ refreshRate: 100 })) + diff --git a/package-lock.json b/package-lock.json index 4a9bf7d..fa7f173 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,454 +1,139 @@ { "name": "stream-log-stats", "version": "3.0.2", - "lockfileVersion": 1, + "lockfileVersion": 3, "requires": true, - "dependencies": { - "@test-runner/default-view": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@test-runner/default-view/-/default-view-0.3.2.tgz", - "integrity": "sha512-yPvElayqNxvdI1NKkOo48ohuCqOJgb4juvc5ihMuuqd2osg4n+qR3Dt0A9vFXd5z7fo3g1ojIYPe9fMiyYuYnQ==", - "dev": true, - "requires": { - "ansi-escape-sequences": "^5.1.1" - } - }, - "JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "requires": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - } - }, - "ansi-escape-sequences": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-5.1.2.tgz", - "integrity": "sha512-JcpoVp1W1bl1Qn4cVuiXEhD6+dyXKSOgCn2zlzE8inYgCJCBy1aPnUhlz6I4DFum8D4ovb9Qi/iAjUcGvG2lqw==", - "requires": { - "array-back": "^4.0.0" - } - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - }, - "array-back": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.0.tgz", - "integrity": "sha512-ylVYjv5BzoWXWO7e6fWrzjqzgxmUPWdQrHxgzo/v1EaYXfw6+6ipRdIr7KryAGnVHG08O1Yfpchuv0+YhjPL+Q==" - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "byte-size": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-6.2.0.tgz", - "integrity": "sha512-6EspYUCAPMc7E2rltBgKwhG+Cmk0pDm9zDtF1Awe2dczNUL3YpZ8mTs/dueOTS1hqGWBOatqef4jYMGjln7WmA==" - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "command-line-args": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.1.1.tgz", - "integrity": "sha512-hL/eG8lrll1Qy1ezvkant+trihbGnaKaeEjj6Scyr3DN+RC7iQ5Rz84IeLERfAWDGo0HBSNAakczwgCilDXnWg==", - "dev": true, - "requires": { - "array-back": "^3.0.1", - "find-replace": "^3.0.0", - "lodash.camelcase": "^4.3.0", - "typical": "^4.0.0" - }, + "packages": { + "": { + "name": "stream-log-stats", + "version": "3.0.2", + "license": "MIT", "dependencies": { - "array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "dev": true - }, - "typical": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", - "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", - "dev": true - } - } - }, - "command-line-usage": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.0.tgz", - "integrity": "sha512-Ew1clU4pkUeo6AFVDFxCbnN7GIZfXl48HIOQeFQnkO3oOqvpI7wdqtLRwv9iOCZ/7A+z4csVZeiDdEcj8g6Wiw==", - "dev": true, - "requires": { - "array-back": "^4.0.0", - "chalk": "^2.4.2", - "table-layout": "^1.0.0", - "typical": "^5.2.0" - } - }, - "common-log-format": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/common-log-format/-/common-log-format-1.0.0.tgz", - "integrity": "sha512-fFn/WPNbsTCGTTwdCpZfVZSa5mgqMEkA0gMTRApFSlEsYN+9B2FPfiqch5FT+jsv5IV1RHV3GeZvCa7Qg+jssw==" - }, - "composite-class": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/composite-class/-/composite-class-1.0.0.tgz", - "integrity": "sha512-WhFlThXtN1DkSWXaQBvZdnjblRWSnKYpI0rHObzQItuv1MleJ1FidaumUmTQoCtA8gaAArrU7YcJM7ncKgKdKg==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "create-mixin": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/create-mixin/-/create-mixin-2.0.1.tgz", - "integrity": "sha512-r11aTk2z5x2C9ZI85oxuZ0EzgjBH0BdGacnXeuA+9d59xV2Hsy+ZpRmU+LUjJT9KdnLgzaxZoCbqrJ5qjl0bAA==", - "dev": true - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "file-set": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/file-set/-/file-set-3.0.0.tgz", - "integrity": "sha512-B/SdeSIeRv7VlOgIjtH3dkxMI+tEy5m+OeCXfAUsirBoVoY+bGtsmvmmTFPm/G23TBY4RiTtjpcgePCfwXRjqA==", - "dev": true, - "requires": { - "array-back": "^4.0.0", - "glob": "^7.1.5" - } - }, - "find-replace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", - "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", - "dev": true, - "requires": { - "array-back": "^3.0.1" + "ansi-escape-sequences": "^6.2.2", + "byte-size": "^9.0.0", + "common-log-format": "^2.0.1", + "JSONStream": "^1.3.5", + "lodash.throttle": "^4.1.1", + "stream-via": "^1.0.4", + "table-layout": "^4.1.1" }, - "dependencies": { - "array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "dev": true - } + "bin": { + "log-stats": "bin/cli.js" + }, + "devDependencies": {}, + "engines": { + "node": ">=8.0.0" } }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "fsm-base": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/fsm-base/-/fsm-base-0.5.0.tgz", - "integrity": "sha512-wJIhIcGwQTSPI6aG13Lhm0G0CoggEBu8NVBWi7zLHrqqBuAXN2i6OMtOv5D/j90CkX/ht3nBA+0QzjMGS8un2w==", - "dev": true, - "requires": { - "array-back": "^4.0.0", - "obso": "^0.5.0", - "reduce-flatten": "^3.0.0" - }, + "node_modules/ansi-escape-sequences": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-6.2.2.tgz", + "integrity": "sha512-mBPG9BZy4dMOJQ9BehU6ph8IKslvVppbqZ8APHnpfP+Hsx/hGow5PY46lSQL1vPPi1F5XTtO6p3GcH8O9c0cUg==", + "license": "MIT", "dependencies": { - "reduce-flatten": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-3.0.0.tgz", - "integrity": "sha512-eczl8wAYBxJ6Egl6I1ECIF+8z6sHu+KE7BzaEDZTpPXKXfy9SUDQlVYwkRcNTjJLC3Iakxbhss50KuT/R6SYfg==", - "dev": true - } + "array-back": "^6.2.2" + }, + "engines": { + "node": ">=12.17" } }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "node_modules/array-back": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", + "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", + "license": "MIT", + "engines": { + "node": ">=12.17" } }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" + "node_modules/byte-size": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-9.0.0.tgz", + "integrity": "sha512-xrJ8Hki7eQ6xew55mM6TG9zHI852OoAHcPfduWWtR6yxk2upTuIZy13VioRBDyHReHDdbeDPifUboeNkK/sXXA==", + "license": "MIT", + "engines": { + "node": ">=12.17" } }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "node_modules/common-log-format": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/common-log-format/-/common-log-format-2.0.1.tgz", + "integrity": "sha512-M+q09UEnd24XMytLMOt6ci9/STbxYH21MNh4dl6GLARTe4+mDuJX0x9cWewD4xfjJbeL8iNIPlmF/5wmJsH2+w==", + "license": "MIT", + "bin": { + "clf": "bin/cli.js" + }, + "engines": { + "node": ">=12" } }, - "jsonparse": { + "node_modules/jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", + "engines": [ + "node >= 0.2.0" + ], + "license": "MIT" }, - "lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", - "dev": true + "node_modules/JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "license": "(MIT OR Apache-2.0)", + "dependencies": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + }, + "bin": { + "JSONStream": "bin.js" + }, + "engines": { + "node": "*" + } }, - "lodash.throttle": { + "node_modules/lodash.throttle": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", - "integrity": "sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } + "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==", + "license": "MIT" }, - "obso": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/obso/-/obso-0.5.0.tgz", - "integrity": "sha512-OIPLscoyq1SRCbbp6VlBWrzG+zR8T8tkic4rHuqABgTYlgqEvvzE5KclPa5sh/jy9x59en9K9JAQFa9ZV8xbVg==", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "race-timeout-anywhere": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/race-timeout-anywhere/-/race-timeout-anywhere-1.0.0.tgz", - "integrity": "sha512-FwYyoKxgK/NNC7Tn2LlFpfNHemLlYOTCruUyYyEzQfkaO4iCQlGipsqOPhJvT7oGinMz707/HAnSFj98b7T4dw==", - "dev": true - }, - "reduce-flatten": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", - "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==" - }, - "sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true - }, - "stream-via": { + "node_modules/stream-via": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/stream-via/-/stream-via-1.0.4.tgz", - "integrity": "sha512-DBp0lSvX5G9KGRDTkR/R+a29H+Wk2xItOF+MpZLLNDWbEV9tGPnqLPxHEYjmiz8xGtJHRIqmI+hCjmNzqoA4nQ==" - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" + "integrity": "sha512-DBp0lSvX5G9KGRDTkR/R+a29H+Wk2xItOF+MpZLLNDWbEV9tGPnqLPxHEYjmiz8xGtJHRIqmI+hCjmNzqoA4nQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" } }, - "table-layout": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.0.tgz", - "integrity": "sha512-o8V8u943KXX9gLNK/Ss1n6Nn4YhpyY/RRnp3hKv/zTA+SXYiQnzJQlR8CZQf1RqYqgkiWMJ54Mv+Vq9Kfzxz1A==", - "requires": { - "array-back": "^3.1.0", - "deep-extend": "~0.6.0", - "typical": "^5.0.0", - "wordwrapjs": "^4.0.0" - }, + "node_modules/table-layout": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-4.1.1.tgz", + "integrity": "sha512-iK5/YhZxq5GO5z8wb0bY1317uDF3Zjpha0QFFLA8/trAoiLbQD0HUbMesEaxyzUgDxi2QlcbM8IvqOlEjgoXBA==", + "license": "MIT", "dependencies": { - "array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==" - } - } - }, - "test-object-model": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/test-object-model/-/test-object-model-0.4.8.tgz", - "integrity": "sha512-VGPdXYx6HVvniKvJI/7dS270SsnIheZ1xYzKK0Yt+flYCazpfPePXjBtx5dr5/aJMPzwKH06NREIgsQMAXLvBw==", - "dev": true, - "requires": { - "composite-class": "^1.0.0", - "create-mixin": "^2.0.1", - "fsm-base": "^0.5.0", - "race-timeout-anywhere": "^1.0.0", - "typical": "^5.2.0" - } - }, - "test-runner": { - "version": "0.7.4", - "resolved": "https://registry.npmjs.org/test-runner/-/test-runner-0.7.4.tgz", - "integrity": "sha512-qxgrKlzhlMfJLfLhrlO75YUGHHnU7jJNXI0UV7OovYBHwD5T7A7GugQ36kIjxAClXV9E83v2EqmzZwQq59Z2sg==", - "dev": true, - "requires": { - "@test-runner/default-view": "^0.3.2", - "command-line-args": "^5.1.1", - "command-line-usage": "^6.1.0", - "file-set": "^3.0.0", - "js-yaml": "^3.13.1", - "reduce-flatten": "^3.0.0", - "test-object-model": "^0.4.8", - "test-runner-core": "^0.7.2", - "walk-back": "^4.0.0" + "array-back": "^6.2.2", + "wordwrapjs": "^5.1.0" }, - "dependencies": { - "reduce-flatten": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-3.0.0.tgz", - "integrity": "sha512-eczl8wAYBxJ6Egl6I1ECIF+8z6sHu+KE7BzaEDZTpPXKXfy9SUDQlVYwkRcNTjJLC3Iakxbhss50KuT/R6SYfg==", - "dev": true - } + "engines": { + "node": ">=12.17" } }, - "test-runner-core": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/test-runner-core/-/test-runner-core-0.7.2.tgz", - "integrity": "sha512-P9GvNFamMHXNZ9PovJfHUGxSTHY7Dn3zhVuIZSMNvsLMX4k1owizrFl02PIr99Zaay4B4JozM4XaILSY9r5LoA==", - "dev": true, - "requires": { - "fsm-base": "^0.5.0", - "test-object-model": "^0.4.7" - } - }, - "through": { + "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" - }, - "typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==" + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "license": "MIT" }, - "walk-back": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-4.0.0.tgz", - "integrity": "sha512-kudCA8PXVQfrqv2mFTG72vDBRi8BKWxGgFLwPpzHcpZnSwZk93WMwUDVcLHWNsnm+Y0AC4Vb6MUNRgaHfyV2DQ==", - "dev": true - }, - "wordwrapjs": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.0.tgz", - "integrity": "sha512-Svqw723a3R34KvsMgpjFBYCgNOSdcW3mQFK4wIfhGQhtaFVOJmdYoXgi63ne3dTlWgatVcUc7t4HtQ/+bUVIzQ==", - "requires": { - "reduce-flatten": "^2.0.0", - "typical": "^5.0.0" + "node_modules/wordwrapjs": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.0.tgz", + "integrity": "sha512-JNjcULU2e4KJwUNv6CHgI46UvDGitb6dGryHajXTDiLgg1/RiGoPSDw4kZfYnwGtEXf2ZMeIewDQgFGzkCB2Sg==", + "license": "MIT", + "engines": { + "node": ">=12.17" } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true } } } diff --git a/package.json b/package.json index 4727571..45671ea 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,10 @@ "author": "Lloyd Brookes <75pound@gmail.com>", "version": "3.0.2", "description": "Prints statistics from the incoming web log stream to the console", - "repository": "https://github.com/75lb/stream-log-stats.git", + "repository": { + "type": "git", + "url": "git+https://github.com/lwsjs/stream-log-stats.git" + }, "license": "MIT", "bin": { "log-stats": "bin/cli.js" @@ -22,21 +25,19 @@ "scripts": { "test": "test-runner test.js" }, - "devDependencies": { - "test-runner": "^0.7.4" - }, + "devDependencies": {}, "dependencies": { "JSONStream": "^1.3.5", - "ansi-escape-sequences": "^5.1.2", - "byte-size": "^6.2.0", - "common-log-format": "^1.0.0", + "ansi-escape-sequences": "^6.2.2", + "byte-size": "^9.0.0", + "common-log-format": "^2.0.1", "lodash.throttle": "^4.1.1", "stream-via": "^1.0.4", - "table-layout": "~1.0.0" + "table-layout": "^4.1.1" }, "files": [ "index.js", - "lib/*.js", - "bin/*.js" + "lib", + "bin" ] } diff --git a/test.js b/test.js index 3d3e1bd..7613bd6 100644 --- a/test.js +++ b/test.js @@ -1,9 +1,11 @@ -const statsView = require('./') -const Tom = require('test-runner').Tom +const statsViewStream = require('./') -const tom = module.exports = new Tom('stats') +const [test, only, skip] = [new Map(), new Map(), new Map()] -tom.test('first', function (t) { - const view = statsView() +test.set('first', function () { + const view = statsViewStream() + /* this is not a valid log file line, looks more like output from Clf */ view.write('{"remoteHost":"127.0.0.1","remoteLogName":"-","authUser":"-","date":"2014-06-11T16:24:02.000Z","request":"GET / HTTP/1.1","status":200,"bytes":10305}{"remoteHost":"127.0.0.1","remoteLogName":"-","authUser":"-","date":"2014-06-11T16:24:08.000Z","request":"GET /package.json HTTP/1.1","status":304,"bytes":null}') }) + +module.exports = { test, only, skip }