# stdout-line

> Log by overwriting previous output

Latest version **0.2.0** (published 2022-01-05) · 0 weekly downloads

## Install

```sh
npm install stdout-line
pnpm add stdout-line
yarn add stdout-line
bun add stdout-line
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2022-01-05 |
| First published | 2022-01-02 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | laggingreflex |
| Keywords | line, log, stdout, update |

## Links

- npm: https://www.npmjs.com/package/stdout-line
- Repository: https://github.com/laggingreflex/stdout-line
- Homepage: https://github.com/laggingreflex/stdout-line#readme
- Issues: https://github.com/laggingreflex/stdout-line/issues
- npm.io page: https://npm.io/package/stdout-line

## 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
- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K 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

## Recent versions

- 0.2.0 (latest) — 2022-01-05
- 0.1.0 — 2022-01-02

## README

# stdout-line

[Yet another] function to log by overwriting previous output.

Differences:

* Single line enforced
* Trims or pads the line to fit the stdout width.
  - This ensures the next log (by other methods: `console.log`) automatically prints to (apparently) next line since the previous line had been fully padded.
* Small, no dependencies

[Yet another]: https://www.npmjs.com/search?q=log+update

## Install

```sh
npm install stdout-line
```

## Usage

```js
import line from 'stdout-line'
line('this will get replaced by')
line('next line')
```
```js
line.persist('unless persisted')
```


## API

```js
import { create } from 'stdout-line'
create(opts)
```

* **`opts.stream`** `[=process.stdout]` Stream to write to
* **`opts.width`** `[number=stream.columns|80]` Width
* **`opts.join`** `[string= ]` Join [...message] array with
* **`opts.throttle`** `[number]` Throttle logging (ms)
* **`opts.format`** `[function]` Format message before writing to `stream`

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