# streaming-format

> Simple streaming formatter

Latest version **2.0.2** (published 2019-04-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install streaming-format
pnpm add streaming-format
yarn add streaming-format
bun add streaming-format
```

Provides the command `format`.

## 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.2 |
| Published | 2019-04-28 |
| First published | 2014-08-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Mathias Buus |
| Maintainers | mafintosh |
| Keywords | stream, streaming, format, template, handlebars, moustache |

## Links

- npm: https://www.npmjs.com/package/streaming-format
- Repository: https://github.com/mafintosh/streaming-format
- Issues: https://github.com/mafintosh/streaming-format/issues
- npm.io page: https://npm.io/package/streaming-format

## Dependencies (3)

- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [through2](https://npm.io/package/through2.md) ^3.0.1
- [buffer-indexof](https://npm.io/package/buffer-indexof.md) ^1.1.1

## 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.2 (latest) — 2019-04-28
- 2.0.1 — 2019-03-09
- 2.0.0 — 2019-03-09
- 1.1.0 — 2014-10-09
- 1.0.0 — 2014-08-20
- 0.0.0 — 2014-08-20

## README

# streaming-format

Simple streaming formatter

```
npm install streaming-format
```

[![build status](http://img.shields.io/travis/mafintosh/streaming-format.svg?style=flat)](http://travis-ci.org/mafintosh/streaming-format)

## Usage

Assuming you have a stream that contains handlebars format values like

```
... BIG DATA ...
{{hello}} world
... MORE BIG DATA ...
```

And you want to replace `{{hello}}` with a another value without reading the entire
stream into memory use this module

``` js
var format = require('streaming-format')

bigData
  .pipe(format(function(name) {
    return name.toUpperCase()
  }))
  .pipe(process.stdout)
```

Which will produce

```
... BIG DATA ...
HELLO world
... MORE BIG DATA ...
```

## API

`var stream = format([opts], replacer)` where `opts` can contain

``` js
{
  start: '{{', // set the format start string
  end: '}}'    // set the format end string
}
```

## Command line tool

There is also a command line tool available

```
npm install -g streaming-format
echo 'hello {{hello}}' | format --hello world # prints hello world
```

## License

MIT

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