# pauls-log-utils

> Use STDIO like your ops console

Latest version **1.1.0** (published 2018-05-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install pauls-log-utils
pnpm add pauls-log-utils
yarn add pauls-log-utils
bun add pauls-log-utils
```

## 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 | 1.1.0 |
| Published | 2018-05-18 |
| First published | 2018-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Paul Frazee |
| Maintainers | pfrazee |
| Keywords | log |

## Links

- npm: https://www.npmjs.com/package/pauls-log-utils
- Repository: https://github.com/pfrazee/pauls-log-utils
- Homepage: https://github.com/pfrazee/pauls-log-utils#readme
- Issues: https://github.com/pfrazee/pauls-log-utils/issues
- npm.io page: https://npm.io/package/pauls-log-utils

## 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

- 1.1.0 (latest) — 2018-05-18
- 1.0.0 — 2018-05-18

## README

# pauls-log-utils

Use STDIO like your ops console. (An assortment of things I needed for Hashbase.)

## summaryConsole

Accumulates the log()s and outputs them on an interval. Duplicates are grouped together.

```js
const {summaryConsole} = require('pauls-log-utils')

summaryConsole.log('Hi!')
summaryConsole.log('Hi!')
summaryConsole.log('Hi!')
// in 30s will output "(3x) Hi!"

summaryConsole.error('same usage as log but to stderr')
summaryConsole.setInterval(5e3) // more frequent
```

## debounceConsole

```
debounceConsole.log(msg, timeout, ...more)
```

Debounces the log()s by the first param `msg`. If only one call is made, will output `...more`. Otherwise will output the repeat count.

```js
const {debounceConsole} = require('pauls-log-utils')

debounceConsole.log('Hi!', 500, 'some', 'more')
debounceConsole.log('Hi!', 500, 'some', 'more')
debounceConsole.log('Hi!', 500, 'some', 'more')
// in 30s will output "Hi! (3x)"

debounceConsole.error('same usage as log but to stderr', 500)
```

Can also specify a max wait on the debounce:

```
debounceConsole.log('Hi!', {timeout: 500, max: 3e3}, 'some', 'more')
```

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