# wrap-stream

> Wrap the output of a stream with a prefix and/or suffix

Latest version **2.0.0** (published 2014-07-29) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2.0.0 |
| Published | 2014-07-29 |
| First published | 2013-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Hugh Kennedy |
| Maintainers | hughsk |
| Keywords | wrap, prefix, suffix, stream, output |

## Links

- npm: https://www.npmjs.com/package/wrap-stream
- Repository: https://github.com/hughsk/wrap-stream
- Issues: https://github.com/hughsk/wrap-stream/issues
- npm.io page: https://npm.io/package/wrap-stream

## Dependencies (1)

- [through2](https://npm.io/package/through2.md) ^0.4.2

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

- 2.0.0 (latest) — 2014-07-29
- 0.0.0 — 2013-10-06

## README

# wrap-stream [![unstable](http://hughsk.github.io/stability-badges/dist/unstable.svg)](http://github.com/hughsk/stability-badges) #

Wrap the output of a stream with a prefix and/or suffix.

Streams2 compliant.

## Usage ##

[![wrap-stream](https://nodei.co/npm/wrap-stream.png?mini=true)](https://nodei.co/npm/wrap-stream)

### `wrap(pre, post)` ###

Returns a through stream that adds `pre` before any other output and `post`
after calling `stream.end()`.

``` javascript
var wrap = require('wrap-stream')
var fs = require('fs')

fs.createReadStream(__filename)
  .pipe(wrap('hello', 'world'))
  .pipe(process.stdout)
```

If you'd prefer not to use either of `pre` or `post`, just pass `null` in its
place.

``` javascript
var wrap = require('wrap-stream')
var fs = require('fs')

fs.createReadStream(__filename)
  .pipe(wrap(null, 'lorem ipsum'))
  .pipe(process.stdout)
```

## License ##

MIT. See [LICENSE.md](http://github.com/hughsk/wrap-stream/blob/master/LICENSE.md) for details.

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