# token-filter

> A Transform stream that replaces delimited keys (tokens) with matching values, like the Ant Filter task.

Latest version **0.2.3** (published 2014-02-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install token-filter
pnpm add token-filter
yarn add token-filter
bun add token-filter
```

## 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.2.3 |
| Published | 2014-02-13 |
| First published | 2014-02-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Daniel Stockman |
| Maintainers | evocateur |
| Keywords | transform, stream, token, filter |

## Links

- npm: https://www.npmjs.com/package/token-filter
- Repository: https://github.com/evocateur/token-filter
- Issues: https://github.com/evocateur/token-filter/issues
- npm.io page: https://npm.io/package/token-filter

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

- 0.2.3 (latest) — 2014-02-13
- 0.2.2 — 2014-02-13
- 0.2.1 — 2014-02-13
- 0.2.0 — 2014-02-13
- 0.1.1 — 2014-02-12
- 0.1.0 — 2014-02-12

## README

# token-filter

A Transform stream that replaces delimited keys (tokens) with matching values, like the Ant Filter task.

[![Build Status](https://travis-ci.org/evocateur/token-filter.png?branch=master)](https://travis-ci.org/evocateur/token-filter)

## Usage

```js
var fs = require('fs');
var tokenFilter = require('token-filter');

// input.txt => "Hello, @name@!"
fs.createReadStream('input.txt')
    .pipe(tokenFilter({ name: "World" }))
    .pipe(fs.createWriteStream('output.txt'));
// output.txt => "Hello, World!"
```

## API

### `tokenFilter(context, [options])`

* `context` {Object} Values to interpolate into matched keys.
* `options` {Object} (optional)
  * `tokenDelimiter` {String} The string that begins and ends a token (default "@").
  * `highWaterMark` {Number} The stream's highWaterMark, defaulting to fs.ReadStream's default (64KB).

Additional stream options are detailed in the [core manual](http://nodejs.org/api/stream.html).

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