# template-stream

> Template Stream

Latest version **0.1.8** (published 2014-03-21) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2014-03-21 |
| First published | 2014-03-12 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | angleman |

## Links

- npm: https://www.npmjs.com/package/template-stream
- npm.io page: https://npm.io/package/template-stream

## Dependencies (2)

- [xtend](https://npm.io/package/xtend.md) ^2.1.2
- [readable-stream](https://npm.io/package/readable-stream.md) ~1.0.26

## Recent versions

- 0.1.8 (latest) — 2014-03-21
- 0.1.7 — 2014-03-13
- 0.1.6 — 2014-03-12
- 0.1.5 — 2014-03-12
- 0.1.4 — 2014-03-12

## README

# template-stream

Template Stream

## Install

```sh
npm install template-stream
```

## Usage

Building your own streams

```js
tStream = new require('template-stream')({ jsonOut: 'auto', filterErrors: false, appendString: '' }) // default config
tStream.bind('onTransform', function(data) {
	// do your processing here
	return data // return data to be pushed down stream, return undefined to filter the data
})
```

## Config

```jsonOut``` json true/false string output down stream. 'auto' = same form as upstream
```filterErrors``` false=json parse errors emit the error, true=json parse errors are silently filtered

## Statistics

```js
// all
console.log(tStream.stat()) // { processed: 942, filtered: 18, badJson: 2 }

// particular statistic
console.log(tStream.stat('filtered')) // 18

// your own statistics
tStream.bump('myStat')
console.log(tStream.stat()) // { processed: 942, filtered: 18, badJson: 2, myStat: 1 }
```

## License

### MIT

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