0.2.3 • Published 10 years ago

token-filter v0.2.3

Weekly downloads
2
License
-
Repository
-
Last release
10 years ago

token-filter

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

Build Status

Usage

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.

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago