# pad-stream

> Pad each line in a stream

Latest version **4.0.0** (published 2022-07-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install pad-stream
pnpm add pad-stream
yarn add pad-stream
bun add pad-stream
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2022-07-26 |
| First published | 2015-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=14.16 |
| Dependencies | 3 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | pad, lpad, padding, indent, left, left-pad, string, stream, streaming, line, lines |

## Links

- npm: https://www.npmjs.com/package/pad-stream
- Repository: https://github.com/sindresorhus/pad-stream
- Homepage: https://github.com/sindresorhus/pad-stream#readme
- Issues: https://github.com/sindresorhus/pad-stream/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/pad-stream

## Dependencies (3)

- [split2](https://npm.io/package/split2.md) ^4.1.0
- [pumpify](https://npm.io/package/pumpify.md) ^2.0.1
- [easy-transform-stream](https://npm.io/package/easy-transform-stream.md) ^1.0.0

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 4.0.0 (latest) — 2022-07-26
- 3.0.0 — 2021-04-09
- 2.0.0 — 2017-01-25
- 1.2.0 — 2015-10-15
- 1.1.0 — 2015-08-20
- 1.0.0 — 2015-01-25

## README

# pad-stream

> Pad each line in a stream

## Install

```sh
npm install pad-stream
```

## Usage

```js
// pad.js
import padStream from 'pad-stream';

process.stdin.pipe(padStream(2, '>')).pipe(process.stdout);
```

```
$ echo 'foo\nbar' | node pad.js
>>foo
>>bar
```

## API

### padStream(count, indent?)

Returns a [transform stream](https://nodejs.org/api/stream.html#stream_duplex_and_transform_streams).

#### count

Type: `number` *(integer)*

The number of times to repeat `indent`.

#### indent

Type: `string`\
Default: `' '`

The string to use as indent.

## Related

- [indent-string](https://github.com/sindresorhus/indent-string) - Indent each line in a string
- [indent-string-cli](https://github.com/sindresorhus/indent-string-cli) - Indent each line in some text or stdin

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