substack/module-deps — pull request #19 by ForbesLindesay (2013-08-14 17:30:45+00:00)
Title: simple transforms

This pull request allows you to write transforms of the form:

```js
function transform(file, source) {
return source.replace(/AAA/g, '5').replace(/BBB/g, '50')
}
```

It also includes a test case.

Since most compilers/transformers are not really streaming, this is a vastly simpler method of operation. It saves each transformer from writing their own code to buffer the `through` stream. This is also hugely beneficial because it means libraries can provide the browserify transform as their main export without bloating their file size when used as a client side module via browserify. For example, I am writing an ES6 transpiler (yes, I know, another one) and want to create an in-browser demo of it working, but I don't really want that demo to require the code for `Buffer` and `stream`.