# stream-buffer-replace

> Efficient streaming find and replace. Buffer based and boundary aware.

Latest version **1.0.1** (published 2015-05-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install stream-buffer-replace
pnpm add stream-buffer-replace
yarn add stream-buffer-replace
bun add stream-buffer-replace
```

## 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.0.1 |
| Published | 2015-05-06 |
| First published | 2015-05-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Andy Kent |
| Maintainers | andykent |

## Links

- npm: https://www.npmjs.com/package/stream-buffer-replace
- Repository: https://github.com/andykent/stream-buffer-replace
- Issues: https://github.com/andykent/stream-buffer-replace/issues
- npm.io page: https://npm.io/package/stream-buffer-replace

## Dependencies (1)

- [buffer-indexof](https://npm.io/package/buffer-indexof.md) 0.0.2

## Recent versions

- 1.0.1 (latest) — 2015-05-06
- 1.0.0 — 2015-05-06

## README

stream-buffer-replace
=====================

Efficient streaming find and replace. Buffer based and boundary aware.

    npm install stream-buffer-replace


Advantages
----------

- never converts Buffers to strings
- only supports exact matching not patterns / regexs
- finds matches that span chunk boundaries
- finds matches that are bigger than a single chunk


Usage
-----

example using strings...

    var fs = require('fs');
    var replace = require('stream-buffer-replace');
    fs.writeFileSync('example.txt', "hello world");

    var stream = fs.createReadStream('example.txt');
    stream.pipe( replace('hello', 'goodbye') ).pipe(process.stdout);

    => goodbye world


example using buffers...

    var fs = require('fs');
    var replace = require('stream-buffer-replace');
    fs.writeFileSync('example.txt', "hello world");

    var stream = fs.createReadStream('example.txt');
    var replacer = replace(new buffer('hello'), new Buffer('goodbye'));
    stream.pipe( replacer ).pipe(process.stdout);

    => goodbye world


Tests
-----

Are written with Mocha and can be run with...

    npm install
    npm test

Contributions welcome.

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