transformify
Takes a synchronous function that transforms a string and converts it into a transform compatible with browserify, catw and mutiny.
Last updated 11 years ago by thlorenz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install transformify 
SYNC missed versions from official npm registry.

transformify build status

Takes a synchronous function that transforms a string and converts it into a transform compatible with browserify, catw and mutiny.

var transformify = require('transformify');

function toUpper(s) {
  return s.toUpperCase();
}

require('fs').createReadStream(__filename)
  .pipe(transformify(toUpper)(/* file not used */))
  .pipe(process.stdout);

Output

VAR TRANSFORMIFY = REQUIRE('TRANSFORMIFY')

FUNCTION TOUPPER(S) {
  RETURN S.TOUPPERCASE();
}

REQUIRE('FS').CREATEREADSTREAM(__FILENAME)
  .PIPE(TRANSFORMIFY(TOUPPER)(/* FILE NOT USED */))
  .PIPE(PROCESS.STDOUT);

Installation

npm install transformify

API

transformify(fn)

/**
 * Takes a synchronous function that transforms a string and returns a transform compatible with browserify, catw and mutiny.
 * 
 * @name transformify
 * @function
 * @param {Function(String):String} fn 
 * @return {Function(String):TransformStream} function that returns a transform stream
 */

License

MIT

Current Tags

  • 0.1.2                                ...           latest (11 years ago)

3 Versions

  • 0.1.2                                ...           11 years ago
  • 0.1.1                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (3)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |